/* ============================================================
   SOSYAL MEDYA TASARIM PANELİ — DESIGN SYSTEM v2.0
   ============================================================ */

/* =============================
   CSS VARIABLES
   ============================= */
:root {
  /* Brand */
  --primary:       #6366f1;
  --primary-d:     #4f46e5;
  --primary-l:     #e0e7ff;
  --secondary:     #06b6d4;
  --accent:        #f59e0b;

  /* Semantic */
  --success:       #10b981;
  --success-l:     #d1fae5;
  --warning:       #f59e0b;
  --warning-l:     #fef3c7;
  --danger:        #ef4444;
  --danger-l:      #fee2e2;
  --info:          #3b82f6;
  --info-l:        #dbeafe;

  /* Neutrals */
  --dark:          #0f172a;
  --dark-2:        #1e293b;
  --dark-3:        #334155;
  --gray:          #64748b;
  --gray-l:        #94a3b8;
  --border:        #e2e8f0;
  --border-l:      #f1f5f9;
  --light:         #f8fafc;
  --white:         #ffffff;

  /* Sidebar */
  --sidebar-bg:    #0f172a;
  --sidebar-w:     260px;
  --sidebar-text:  #94a3b8;
  --sidebar-hover: rgba(255,255,255,0.06);
  --sidebar-active:#6366f1;

  /* Dimensions */
  --header-h:      64px;
  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     16px;
  --radius-xl:     24px;

  /* Shadows */
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:        0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.06);
  --shadow-md:     0 8px 24px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.06);
  --shadow-lg:     0 20px 40px rgba(0,0,0,.12), 0 8px 16px rgba(0,0,0,.08);
  --shadow-colored:0 8px 24px rgba(99,102,241,.25);

  /* Transitions */
  --t-fast:        150ms cubic-bezier(.4,0,.2,1);
  --t:             250ms cubic-bezier(.4,0,.2,1);
  --t-slow:        400ms cubic-bezier(.4,0,.2,1);

  /* Font */
  --font:          'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* =============================
   RESET & BASE
   ============================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--light); color: var(--dark); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--primary-d); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* =============================
   SCROLLBAR
   ============================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-l); }

/* =============================
   CONTAINER
   ============================= */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* =============================
   ADMIN LAYOUT
   ============================= */
.admin-wrapper { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 300;
  transition: transform var(--t), width var(--t);
  overflow: hidden;
  overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); }

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.sidebar-logo {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99,102,241,.4);
}
.sidebar-title { font-size: .875rem; font-weight: 700; color: var(--white); line-height: 1.2; display: block; }
.sidebar-sub   { font-size: .7rem; color: var(--sidebar-text); display: block; margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 12px 12px; }
.nav-section  { margin-bottom: 8px; }
.nav-section-title {
  font-size: .65rem; font-weight: 700; letter-spacing: .08em;
  color: rgba(148,163,184,.5); text-transform: uppercase;
  padding: 10px 10px 4px; display: block;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: .875rem; font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
  margin-bottom: 2px;
  position: relative;
}
.nav-item:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.nav-item.active {
  background: rgba(99,102,241,.15);
  color: #a5b4fc;
  border-left: 3px solid var(--sidebar-active);
  padding-left: 7px;
}
.nav-item.active .nav-icon { color: #818cf8; }
.nav-icon { width: 18px; font-size: .95rem; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: var(--primary);
  color: #fff; font-size: .65rem; font-weight: 700;
  padding: 1px 7px; border-radius: 99px;
}
.nav-item-sub { padding-left: 38px; font-size: .82rem; color: rgba(148,163,184,.7); }
.nav-item-sub:hover { color: #e2e8f0; }
.nav-item-sub.active { color: #a5b4fc; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.admin-info {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.04);
}
.admin-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; flex-shrink: 0;
}
.admin-name { font-size: .8rem; font-weight: 600; color: #e2e8f0; display: block; line-height: 1.3; }
.logout-link { font-size: .7rem; color: rgba(148,163,184,.7); transition: color var(--t-fast); display: block; }
.logout-link:hover { color: var(--danger); }

/* SIDEBAR COLLAPSED (masaüstü) */
.sidebar.collapsed {
  width: 64px;
}
.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .sidebar-sub,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-item span:not(.nav-icon),
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .admin-name,
.sidebar.collapsed .logout-link,
.sidebar.collapsed .nav-item-sub {
  display: none;
}
.sidebar.collapsed .sidebar-header { justify-content: center; padding: 16px 12px; }
.sidebar.collapsed .sidebar-logo   { margin: 0 auto; }
.sidebar.collapsed .sidebar-nav    { padding: 12px 8px; }
.sidebar.collapsed .nav-item       { justify-content: center; padding: 10px; }
.sidebar.collapsed .nav-icon       { width: auto; font-size: 1.1rem; }
.sidebar.collapsed .nav-item.active { border-left: none; padding-left: 10px; border-radius: var(--radius-sm); }
.sidebar.collapsed .sidebar-footer { padding: 8px; }
.sidebar.collapsed .admin-info     { justify-content: center; padding: 8px; }
.sidebar.collapsed .admin-avatar   { margin: 0; }

/* ADMIN CONTENT */
.admin-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; transition: margin-left var(--t); }
.admin-content.sidebar-collapsed { margin-left: 64px; }

/* TOPBAR */
.topbar {
  height: var(--header-h);
  background: var(--white);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 1px 0 var(--border);
}
.topbar-left  { display: flex; align-items: center; gap: 12px; }
.sidebar-toggle {
  display: flex; flex-direction: column; gap: 5px;
  background: none; border: none; padding: 6px;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast);
}
.sidebar-toggle:hover { background: var(--light); }
.sidebar-toggle span {
  display: block; width: 20px; height: 2px;
  background: var(--dark-3); border-radius: 2px;
  transition: transform var(--t), opacity var(--t);
}
.page-title { font-size: 1rem; font-weight: 600; color: var(--dark); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.admin-footer { padding: 10px 28px; background: var(--white); border-top: 1px solid var(--border-l); font-size: .72rem; color: var(--gray-l); text-align: right; }

/* CONTENT BODY */
.content-body { padding: 28px; flex: 1; }

/* SIDEBAR OVERLAY */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 250;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* =============================
   BUTTONS
   ============================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 600; line-height: 1;
  border: 1.5px solid transparent;
  cursor: pointer; transition: all var(--t-fast);
  white-space: nowrap; text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn-primary   { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); color: #fff; box-shadow: var(--shadow-colored); transform: translateY(-1px); }
.btn-secondary { background: var(--dark-3); color: #fff; border-color: var(--dark-3); }
.btn-secondary:hover { background: var(--dark-2); color: #fff; }
.btn-success   { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #059669; color: #fff; }
.btn-danger    { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-warning   { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover { background: #d97706; color: #fff; }
.btn-outline   { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-l); color: var(--primary-d); }
.btn-outline-gray { background: transparent; color: var(--gray); border-color: var(--border); }
.btn-outline-gray:hover { background: var(--light); color: var(--dark); }
.btn-ghost     { background: transparent; color: var(--gray); border-color: transparent; }
.btn-ghost:hover { background: var(--light); color: var(--dark); }
.btn-white     { background: #fff; color: var(--dark); border-color: #fff; }
.btn-white:hover { background: #f1f5f9; color: var(--dark); }

.btn-sm  { padding: 6px 14px; font-size: .8rem; }
.btn-xs  { padding: 4px 10px; font-size: .75rem; border-radius: 5px; }
.btn-lg  { padding: 12px 28px; font-size: 1rem; border-radius: var(--radius); }
.btn-xl  { padding: 16px 36px; font-size: 1.1rem; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn-icon  { padding: 8px; border-radius: var(--radius-sm); }
.btn-icon.btn-sm { padding: 5px; }

/* =============================
   FORMS
   ============================= */
.form-group   { margin-bottom: 20px; }
.form-label   { display: block; font-size: .82rem; font-weight: 600; color: var(--dark-3); margin-bottom: 6px; }
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--white); color: var(--dark);
  font-size: .9rem; line-height: 1.5;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  appearance: none;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.form-control::placeholder { color: var(--gray-l); }
.form-control:disabled { background: var(--light); color: var(--gray); cursor: not-allowed; }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; 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='%2364748b' 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: .75rem; color: var(--gray-l); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-card { background: var(--white); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm); border: 1px solid var(--border-l); margin-bottom: 20px; }
.form-card-title { font-size: .95rem; font-weight: 700; color: var(--dark); margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border-l); display: flex; align-items: center; gap: 8px; }
.form-actions { display: flex; gap: 10px; align-items: center; padding-top: 8px; }

/* Checkbox / Toggle */
.form-check { display: flex; align-items: center; gap: 10px; }
.form-check-input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.form-check-label { font-size: .875rem; color: var(--dark-3); cursor: pointer; font-weight: 500; }

/* Color Picker */
.color-picker-group { display: flex; align-items: center; gap: 10px; }
.color-input { width: 44px; height: 38px; padding: 2px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: none; }
.color-text { flex: 1; }

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--t);
  background: var(--light);
  position: relative;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-l);
}
.upload-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-icon { font-size: 2rem; margin-bottom: 8px; }
.upload-text { font-size: .875rem; color: var(--gray); }
.upload-text strong { color: var(--primary); }
.upload-hint { font-size: .75rem; color: var(--gray-l); margin-top: 4px; }
.upload-preview {
  display: none; margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden; position: relative;
}
.upload-preview img { width: 100%; max-height: 200px; object-fit: contain; background: #f8fafc; }
.upload-preview .remove-preview {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,.5); color: #fff;
  border: none; border-radius: 50%;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: .8rem; transition: background var(--t-fast);
}
.upload-preview .remove-preview:hover { background: var(--danger); }
.upload-file-info { padding: 10px 12px; background: var(--light); font-size: .8rem; color: var(--gray); display: flex; align-items: center; gap: 8px; }
.current-file { margin-top: 12px; padding: 10px 14px; background: var(--light); border-radius: var(--radius-sm); border: 1px solid var(--border); display: flex; align-items: center; gap: 12px; font-size: .82rem; color: var(--gray); }
.current-logo, .current-design-img { width: 60px; height: 60px; object-fit: contain; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff; }
.file-badge { display: inline-block; padding: 2px 8px; background: var(--primary-l); color: var(--primary-d); border-radius: 99px; font-size: .72rem; font-weight: 600; }

/* =============================
   CARDS
   ============================= */
.card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-l);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border-l);
}
.card-title { font-size: .95rem; font-weight: 700; color: var(--dark); display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }

/* =============================
   TABLES
   ============================= */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.table {
  width: 100%; border-collapse: collapse;
  font-size: .875rem;
}
.table th {
  background: var(--light); color: var(--dark-3);
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border-l); vertical-align: middle; color: var(--dark-2); }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: #fafbfd; }
.table-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--light); }
.color-swatch { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(0,0,0,.1); vertical-align: middle; margin-right: 6px; }
.action-buttons { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }

/* =============================
   BADGES
   ============================= */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 99px;
  font-size: .72rem; font-weight: 600;
  color: #fff; white-space: nowrap;
}
.badge-success { background: var(--success); }
.badge-danger  { background: var(--danger); }
.badge-warning { background: var(--warning); }
.badge-info    { background: var(--info); }
.badge-gray    { background: var(--gray); }
.badge-outline { background: transparent; border: 1.5px solid var(--border); color: var(--gray); }
.badge-primary { background: var(--primary); }

/* =============================
   ALERTS
   ============================= */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  margin-bottom: 16px; font-size: .875rem;
  display: flex; align-items: flex-start; gap: 10px;
  animation: slideDown .25s ease;
}
.alert-success { background: var(--success-l); color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger, .alert-error  { background: var(--danger-l); color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: var(--warning-l); color: #78350f; border: 1px solid #fcd34d; }
.alert-info    { background: var(--info-l); color: #1e40af; border: 1px solid #93c5fd; }
.alert-error ul { padding-left: 16px; list-style: disc; margin-top: 4px; }
.alert-close { margin-left: auto; cursor: pointer; background: none; border: none; font-size: 1rem; color: inherit; opacity: .6; transition: opacity var(--t-fast); padding: 0 4px; flex-shrink: 0; }
.alert-close:hover { opacity: 1; }
.flash-msg { margin: 12px 28px 0; }

@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* =============================
   DASHBOARD — STAT CARDS
   ============================= */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }

.stat-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 20px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-l);
  position: relative; overflow: hidden;
  transition: transform var(--t), box-shadow var(--t);
  text-decoration: none; cursor: default;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.stat-card.stat-blue::before   { background: linear-gradient(90deg, #6366f1, #818cf8); }
.stat-card.stat-purple::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.stat-card.stat-green::before  { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-card.stat-orange::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.stat-top { display: flex; align-items: flex-start; justify-content: space-between; }
.stat-icon {
  width: 44px; height: 44px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.stat-card.stat-blue   .stat-icon { background: #e0e7ff; }
.stat-card.stat-purple .stat-icon { background: #ede9fe; }
.stat-card.stat-green  .stat-icon { background: #d1fae5; }
.stat-card.stat-orange .stat-icon { background: #fef3c7; }

.stat-info { display: flex; flex-direction: column; gap: 2px; }
.stat-value { font-size: 1.9rem; font-weight: 800; line-height: 1; color: var(--dark); letter-spacing: -.03em; }
.stat-label { font-size: .78rem; color: var(--gray); font-weight: 500; }
.stat-link  { font-size: .75rem; color: var(--primary); font-weight: 600; transition: gap var(--t-fast); align-self: flex-end; }
.stat-link:hover { color: var(--primary-d); }

/* DASHBOARD GRID */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.mt-4 { margin-top: 20px; }
.mt-2 { margin-top: 8px; }
.mb-4 { margin-bottom: 20px; }
.mb-0 { margin-bottom: 0 !important; }
.p-0  { padding: 0 !important; }
.d-block { display: block; }
.text-muted { color: var(--gray-l); }

/* PROGRESS BARS */
.school-bars { display: flex; flex-direction: column; gap: 14px; }
.school-bar-item {}
.school-bar-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.school-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.school-bar-name  { flex: 1; font-size: .82rem; font-weight: 500; color: var(--dark-2); }
.school-bar-count { font-size: .78rem; color: var(--gray); font-weight: 600; }
.progress-bar { height: 6px; background: var(--border-l); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; transition: width 1s cubic-bezier(.4,0,.2,1); }

/* RECENT LIST */
.recent-list { display: flex; flex-direction: column; gap: 2px; }
.recent-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border-radius: var(--radius-sm);
  transition: background var(--t-fast);
}
.recent-item:hover { background: var(--light); }
.recent-thumb {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  overflow: hidden; flex-shrink: 0; background: var(--light);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
}
.recent-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-icon { font-size: 1.2rem; }
.recent-info { flex: 1; min-width: 0; }
.recent-title { font-size: .82rem; font-weight: 600; color: var(--dark); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-meta  { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.recent-actions { flex-shrink: 0; }

/* SCHOOL QUICK GRID */
.school-quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.school-quick-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 12px; border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--white); text-decoration: none;
  transition: all var(--t);
}
.school-quick-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.school-quick-logo { width: 48px; height: 48px; object-fit: contain; border-radius: var(--radius-sm); }
.school-quick-icon {
  width: 48px; height: 48px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.school-quick-icon-add { background: var(--border-l); }
.school-quick-name  { font-size: .75rem; font-weight: 600; color: var(--dark); text-align: center; line-height: 1.3; }
.school-quick-count { font-size: .7rem; color: var(--gray-l); }
.school-quick-add { border-style: dashed; }
.school-quick-add:hover { border-color: var(--primary); background: var(--primary-l); }

/* =============================
   DESIGN GRID (Admin)
   ============================= */
.design-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

.design-card {
  background: var(--white); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-l);
  transition: transform var(--t), box-shadow var(--t);
}
.design-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.design-thumb {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden;
  background: var(--light);
  display: flex; align-items: center; justify-content: center;
}
.design-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow); }
.design-card:hover .design-thumb img { transform: scale(1.04); }
.design-overlay {
  position: absolute; inset: 0;
  background: rgba(15,23,42,.55);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  opacity: 0; transition: opacity var(--t);
}
.design-card:hover .design-overlay { opacity: 1; }
.file-icon-box {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  font-size: 2.5rem; color: var(--gray);
}
.file-pdf  { color: #dc2626; }
.file-icon-box small { font-size: .75rem; font-weight: 600; }

.design-info { padding: 12px; }
.design-title { font-size: .82rem; font-weight: 600; color: var(--dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; }
.design-badges { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.design-actions { display: flex; gap: 6px; }
.design-meta { font-size: .72rem; color: var(--gray-l); margin-top: 4px; }

/* FILTER BAR */
.filter-bar {
  background: var(--white); padding: 16px 20px;
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-l); margin-bottom: 20px;
}
.filter-form {}
.filter-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.filter-group { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 140px; }
.filter-group label { font-size: .75rem; font-weight: 600; color: var(--gray); }
.filter-search { flex: 2; }
.filter-actions { display: flex; gap: 8px; align-items: flex-end; flex-shrink: 0; }

/* =============================
   EMPTY STATE
   ============================= */
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray-l); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; display: block; }
.empty-state h3 { font-size: 1.1rem; color: var(--dark-3); margin-bottom: 8px; }
.empty-state p  { font-size: .875rem; margin-bottom: 20px; }
.empty-state-public { padding: 80px 20px; }

/* =============================
   PAGINATION
   ============================= */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 28px; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  font-size: .82rem; font-weight: 600;
  border: 1.5px solid var(--border); background: var(--white);
  color: var(--dark-3); transition: all var(--t-fast);
  text-decoration: none;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-l); }
.pagination .active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .disabled { color: var(--gray-l); cursor: default; pointer-events: none; }
.pagination .ellipsis { border: none; background: none; color: var(--gray-l); }

/* =============================
   CATEGORY TREE (Admin)
   ============================= */
.cat-tree { display: flex; flex-direction: column; gap: 2px; }
.cat-tree-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-l); background: var(--white);
  transition: background var(--t-fast);
}
.cat-tree-item:hover { background: var(--light); }
.cat-tree-label { display: flex; align-items: center; gap: 8px; font-size: .875rem; font-weight: 500; }
.cat-tree-indent { display: inline-flex; }
.cat-tree-icon { font-size: 1rem; }
.cat-tree-actions { display: flex; gap: 6px; align-items: center; }

/* =============================
   PUBLIC SITE — HEADER
   ============================= */
.public-layout { background: #f8fafc; }

.public-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1rem; color: var(--dark);
  text-decoration: none;
}
.brand-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  box-shadow: 0 2px 8px rgba(99,102,241,.3);
}
.public-nav { display: flex; align-items: center; gap: 16px; }
.nav-link { font-size: .875rem; font-weight: 500; color: var(--gray); transition: color var(--t-fast); }
.nav-link:hover { color: var(--primary); }

/* =============================
   PUBLIC — HERO
   ============================= */
.public-hero {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 60%, #1e1b4b 100%);
  color: #fff;
  padding: 60px 0 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.public-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99,102,241,.25) 0%, transparent 70%);
}
.public-hero .container { position: relative; }
.public-hero h1 {
  font-size: 2.4rem; font-weight: 800; margin-bottom: 14px;
  letter-spacing: -.03em; line-height: 1.15;
}
.public-hero h1 span { background: linear-gradient(90deg, #a5b4fc, #818cf8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.public-hero p { font-size: 1rem; color: rgba(255,255,255,.7); max-width: 520px; margin: 0 auto 28px; line-height: 1.7; }

.hero-stats { display: flex; align-items: center; justify-content: center; gap: 40px; }
.hero-stat strong { display: block; font-size: 1.8rem; font-weight: 800; color: #fff; letter-spacing: -.03em; }
.hero-stat span   { font-size: .8rem; color: rgba(255,255,255,.5); font-weight: 500; }
.hero-divider { width: 1px; height: 36px; background: rgba(255,255,255,.15); }

/* =============================
   PUBLIC — FILTER
   ============================= */
.public-filter {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky; top: 60px; z-index: 90;
  box-shadow: var(--shadow-sm);
}
.public-main { }

/* SCHOOL TABS */
.school-tabs {
  display: flex; gap: 6px;
  overflow-x: auto; padding-bottom: 2px;
  scrollbar-width: none;
  flex-wrap: nowrap;
}
.school-tabs::-webkit-scrollbar { display: none; }

.school-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: 99px; font-size: .8rem; font-weight: 600;
  border: 1.5px solid var(--border); background: var(--white);
  color: var(--dark-3); white-space: nowrap;
  transition: all var(--t-fast); text-decoration: none; flex-shrink: 0;
}
.school-tab:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-l); }
.school-tab.active { border-color: var(--primary); background: var(--primary); color: #fff; }
.tab-logo { width: 18px; height: 18px; border-radius: 3px; object-fit: contain; }

/* CATEGORY PILLS */
.category-filter {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border-l);
}
.cat-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 99px;
  font-size: .75rem; font-weight: 600;
  border: 1.5px solid var(--border); background: var(--white);
  color: var(--gray); white-space: nowrap;
  transition: all var(--t-fast); text-decoration: none;
}
.cat-pill:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-l); }
.cat-pill.active { border-color: var(--primary); background: var(--primary); color: #fff; }
.cat-pill-child { padding-left: 20px; font-size: .72rem; }

/* =============================
   PUBLIC GALLERY
   ============================= */
.gallery-header { display: flex; align-items: center; justify-content: space-between; padding: 24px 0 16px; }
.gallery-title  { font-size: 1.2rem; font-weight: 700; color: var(--dark); display: flex; align-items: center; gap: 10px; }
.gallery-count  { font-size: .82rem; font-weight: 500; color: var(--gray-l); background: var(--light); padding: 2px 10px; border-radius: 99px; border: 1px solid var(--border); }

.public-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  padding-bottom: 60px;
}

.gallery-item {
  background: var(--white); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-l);
  transition: transform var(--t), box-shadow var(--t);
  animation: fadeUp .4s ease both;
}
.gallery-item:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.gallery-thumb {
  position: relative; aspect-ratio: 4/3; overflow: hidden;
  background: var(--light);
  display: flex; align-items: center; justify-content: center;
}
.gallery-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s cubic-bezier(.4,0,.2,1);
}
.gallery-item:hover .gallery-thumb img { transform: scale(1.06); }

.gallery-overlay {
  position: absolute; inset: 0;
  background: rgba(15,23,42,.6);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  opacity: 0; transition: opacity var(--t);
  backdrop-filter: blur(2px);
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-video { width: 100%; aspect-ratio: 16/9; display: block; }

.gallery-info { padding: 14px; }
.gallery-item-title { font-size: .875rem; font-weight: 700; color: var(--dark); margin-bottom: 8px; line-height: 1.4; }
.gallery-badges { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 6px; }
.gallery-desc   { font-size: .78rem; color: var(--gray); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* =============================
   LIGHTBOX
   ============================= */
.lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.92);
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
}
.lightbox.open { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.lightbox-inner {
  position: relative; max-width: 90vw; max-height: 90vh;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.lightbox-inner img {
  max-width: 85vw; max-height: 80vh;
  object-fit: contain; border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: zoomIn .25s ease;
}
@keyframes zoomIn { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.lightbox-close {
  position: absolute; top: -48px; right: 0;
  background: rgba(255,255,255,.12); color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  width: 36px; height: 36px; border-radius: 50%;
  font-size: .9rem; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--t-fast);
}
.lightbox-close:hover { background: rgba(255,255,255,.25); }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.1); color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  width: 44px; height: 44px; border-radius: 50%;
  font-size: 1.5rem; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--t-fast);
}
.lightbox-nav:hover { background: rgba(255,255,255,.2); transform: translateY(-50%) scale(1.05); }
.lightbox-prev { left: -60px; }
.lightbox-next { right: -60px; }
.lightbox-inner p { color: rgba(255,255,255,.7); font-size: .875rem; text-align: center; }
.lightbox-counter { position: absolute; bottom: -32px; left: 50%; transform: translateX(-50%); font-size: .75rem; color: rgba(255,255,255,.4); }

/* =============================
   LOGIN PAGE
   ============================= */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 50%, #1e1b4b 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  position: relative;
}
.login-page::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(99,102,241,.2) 0%, transparent 70%);
}
.login-wrapper { position: relative; width: 100%; max-width: 420px; }
.login-card {
  background: rgba(255,255,255,.03);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: 0 24px 48px rgba(0,0,0,.4);
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-logo {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  border-radius: var(--radius-lg); margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 8px 24px rgba(99,102,241,.4);
}
.login-title    { font-size: 1.5rem; font-weight: 800; color: #fff; margin-bottom: 6px; }
.login-subtitle { font-size: .85rem; color: rgba(255,255,255,.5); }
.login-form .form-label { color: rgba(255,255,255,.7); }
.login-form .form-control {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
  color: #fff;
}
.login-form .form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.2); }
.login-form .form-control::placeholder { color: rgba(255,255,255,.25); }
.input-group { position: relative; }
.input-addon {
  position: absolute; right: 0; top: 0; bottom: 0;
  display: flex; align-items: center; padding: 0 12px;
  cursor: pointer;
}
.input-addon button {
  background: none; border: none; color: rgba(255,255,255,.4);
  font-size: .85rem; cursor: pointer; transition: color var(--t-fast);
}
.input-addon button:hover { color: rgba(255,255,255,.8); }
.login-hint { margin-top: 20px; text-align: center; font-size: .78rem; color: rgba(255,255,255,.3); }
.login-form .alert-danger { background: rgba(239,68,68,.15); border-color: rgba(239,68,68,.3); color: #fca5a5; }

/* =============================
   PUBLIC FOOTER
   ============================= */
.public-footer {
  background: var(--dark); color: rgba(255,255,255,.3);
  padding: 24px; text-align: center; font-size: .82rem;
}

/* BACK TO TOP */
#backToTop {
  position: fixed; bottom: 24px; right: 24px; z-index: 500;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: #fff;
  border: none; font-size: 1rem;
  box-shadow: var(--shadow-md);
  cursor: pointer; opacity: 0; pointer-events: none;
  transition: all var(--t);
  display: flex; align-items: center; justify-content: center;
}
#backToTop.show { opacity: 1; pointer-events: auto; }
#backToTop:hover { background: var(--primary-d); transform: translateY(-2px); }

/* =============================
   UTILITY
   ============================= */
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-4 { flex: 0 0 33.33%; max-width: 33.33%; }
.col-8 { flex: 0 0 66.67%; max-width: 66.67%; }
.gap-2 { gap: 8px; }
.flex  { display: flex; }
.items-center { align-items: center; }

/* =============================
   RESPONSIVE
   ============================= */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .admin-content { margin-left: 0; }
  .content-body { padding: 16px; }
  .topbar { padding: 0 16px; }
  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .public-hero h1 { font-size: 1.7rem; }
  .hero-stats { gap: 20px; }
  .public-gallery { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .filter-row { flex-direction: column; }
  .school-quick-grid { grid-template-columns: repeat(auto-fill, minmax(110px,1fr)); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .design-grid { grid-template-columns: 1fr 1fr; }
  .public-gallery { grid-template-columns: 1fr 1fr; }
  .hero-stats { flex-direction: column; gap: 12px; }
  .hero-divider { display: none; }
  .login-card { padding: 28px 20px; }
  .pagination a, .pagination span { width: 32px; height: 32px; font-size: .75rem; }
}
