/* ==========================================================================
   GAPURA CREATIVE - ADMIN DASHBOARD STYLESHEET (2026 EDITION)
   Clean Pure White Canvas, Blue Gradient & Orange Accent
   High-Contrast Black Typography
   ========================================================================== */

:root {
  /* Clean White & Light Canvas */
  --admin-bg: #f8fafc;
  --admin-sidebar: #ffffff;
  --admin-card: #ffffff;
  --admin-card-hover: #f1f5f9;
  --admin-border: #e2e8f0;
  --admin-border-focus: #0b76b4;

  /* Blue Gradient from Logo: #0b76b4 > #41a0d8 */
  --color-blue-dark: #0b76b4;
  --color-blue-light: #41a0d8;
  --gradient-blue: linear-gradient(135deg, #0b76b4 0%, #41a0d8 100%);
  --accent-pink: #0b76b4;
  --accent-pink-hover: #096499;
  --accent-pink-glow: rgba(11, 118, 180, 0.25);
  --accent-pink-subtle: rgba(11, 118, 180, 0.08);

  /* Orange Accent from Logo: #f7941d */
  --accent-orange: #f7941d;
  --accent-orange-hover: #e07f0f;
  --gradient-orange: linear-gradient(135deg, #f7941d 0%, #ffaa3b 100%);

  /* High-Contrast Pure Black & Charcoal Typography */
  --text-title: #000000;
  --text-main: #111827;
  --text-body: #1f2937;
  --text-muted: #4b5563;
  --text-dark: #64748b;

  --status-green: #16a34a;
  --status-yellow: #ca8a04;
  --status-red: #dc2626;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 20px -2px rgba(11, 118, 180, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.admin-body {
  font-family: var(--font-sans);
  background-color: var(--admin-bg);
  color: var(--text-body);
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 270px;
  background-color: var(--admin-sidebar);
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 18px;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--admin-border);
  text-decoration: none;
}

.sidebar-brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gradient-blue);
  box-shadow: 0 4px 12px rgba(11, 118, 180, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  stroke: #ffffff;
}

.sidebar-brand-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-title);
  letter-spacing: -0.02em;
}

.sidebar-brand-title span {
  color: var(--color-blue-dark);
}

.sidebar-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-orange);
  text-transform: uppercase;
  background: rgba(247, 148, 29, 0.12);
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-block;
  margin-top: 2px;
}

.sidebar-nav {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
  flex-grow: 1;
}

.nav-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dark);
  padding: 14px 12px 6px 12px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar-link:hover {
  background: var(--admin-bg);
  color: var(--color-blue-dark);
}

.sidebar-link.active {
  background: rgba(11, 118, 180, 0.08);
  color: var(--color-blue-dark);
  font-weight: 700;
  border-left: 3px solid var(--color-blue-dark);
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.sidebar-footer {
  padding-top: 18px;
  border-top: 1px solid var(--admin-border);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--admin-bg);
  border-radius: 10px;
  border: 1px solid var(--admin-border);
}

.user-info-text {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-title);
}

.user-role-text {
  font-size: 0.72rem;
  color: var(--text-dark);
  text-transform: uppercase;
  font-weight: 700;
}

/* Main Content Area */
.admin-main {
  margin-left: 270px;
  flex-grow: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  height: 72px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-title);
  letter-spacing: -0.02em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-admin-primary {
  background: var(--gradient-blue);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(11, 118, 180, 0.25);
}

.btn-admin-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(11, 118, 180, 0.35);
}

.btn-admin-orange {
  background: var(--gradient-orange);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(247, 148, 29, 0.3);
}

.btn-admin-orange:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(247, 148, 29, 0.4);
}

.btn-admin-secondary {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  color: var(--text-title);
  box-shadow: var(--shadow-sm);
}

.btn-admin-secondary:hover {
  background: var(--admin-bg);
  color: var(--color-blue-dark);
  border-color: var(--color-blue-dark);
}

.btn-admin-danger {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #dc2626;
}

.btn-admin-danger:hover {
  background: #dc2626;
  color: #ffffff;
}

/* Page Body */
.admin-content {
  padding: 32px;
  flex-grow: 1;
}

/* Flash Messages */
.flash-container {
  margin-bottom: 24px;
}

.alert {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alert-success {
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.3);
  color: #15803d;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #dc2626;
}

.alert-warning {
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.3);
  color: #b45309;
}

.alert-info {
  background: rgba(11, 118, 180, 0.1);
  border: 1px solid rgba(11, 118, 180, 0.3);
  color: #0b76b4;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-box {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  padding: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.stat-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-blue);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(11, 118, 180, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  stroke: var(--color-blue-dark);
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-title);
  line-height: 1;
}

/* Cards & Tables */
.admin-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.admin-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-title);
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-input, .select-input {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--text-title);
  font-family: inherit;
  font-size: 0.88rem;
}

.search-input:focus, .select-input:focus {
  outline: none;
  border-color: var(--color-blue-dark);
  box-shadow: 0 0 0 3px rgba(11, 118, 180, 0.12);
}

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  padding: 14px 20px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-title);
  border-bottom: 1.5px solid var(--admin-border);
  background: #f1f5f9;
}

.admin-table td {
  padding: 16px 20px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--admin-border);
  color: var(--text-body);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: #f8fafc;
}

.project-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.project-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--admin-border);
  background: #f1f5f9;
}

.project-cell-title {
  font-weight: 800;
  color: var(--text-title);
  font-size: 0.95rem;
}

.project-cell-client {
  font-size: 0.8rem;
  color: var(--color-blue-dark);
  font-weight: 700;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-published {
  background: rgba(22, 163, 74, 0.1);
  color: #15803d;
  border: 1px solid rgba(22, 163, 74, 0.3);
}

.badge-draft {
  background: rgba(234, 179, 8, 0.12);
  color: #b45309;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.badge-featured {
  background: rgba(11, 118, 180, 0.1);
  color: var(--color-blue-dark);
  border: 1px solid rgba(11, 118, 180, 0.3);
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 28px;
}

.admin-form-group {
  margin-bottom: 20px;
}

.admin-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-title);
  margin-bottom: 8px;
}

.admin-input, .admin-select, .admin-textarea {
  width: 100%;
  padding: 12px 16px;
  background: #ffffff;
  border: 1.5px solid var(--admin-border);
  border-radius: 10px;
  color: var(--text-title);
  font-family: inherit;
  font-size: 0.92rem;
  transition: all 0.2s ease;
}

.admin-input:focus, .admin-select:focus, .admin-textarea:focus {
  outline: none;
  border-color: var(--color-blue-dark);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(11, 118, 180, 0.15);
}

.metrics-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: var(--admin-bg);
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--admin-border);
  margin-bottom: 16px;
}

/* Login Page Specific */
.login-body {
  background: linear-gradient(135deg, #f0f7fc 0%, #ffffff 50%, #fef8f0 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border: 1.5px solid var(--admin-border);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 20px 50px rgba(11, 118, 180, 0.1);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-blue);
}

@media (max-width: 1024px) {
  .admin-sidebar { width: 80px; padding: 20px 10px; }
  .admin-sidebar .sidebar-brand-title, 
  .admin-sidebar .sidebar-badge,
  .admin-sidebar .nav-section-title,
  .admin-sidebar .sidebar-link span,
  .admin-sidebar .user-info-text,
  .admin-sidebar .user-role-text { display: none; }
  .admin-main { margin-left: 80px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr; }
  .admin-topbar { padding: 0 16px; }
  .admin-content { padding: 16px; }
}
