/* Digital Hub Admin Styles */

.admin-body { display: flex; min-height: 100vh; background: #f1f5f9; }

.admin-sidebar {
  width: 250px; background: var(--navy); color: white;
  display: flex; flex-direction: column;
  padding: 0; position: fixed;
  top: 0; left: 0; bottom: 0; z-index: 200; overflow-y: auto;
}
.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 8px;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 1.2rem; font-weight: 800;
}
.sidebar-logo strong { color: var(--blue-light); }
.sidebar-logo .logo-icon { width: 32px; height: 32px; border-radius: 9px; font-size: 15px; }
.sidebar-subtitle { font-size: 11px; color: #475569; margin-top: 6px; text-transform: uppercase; letter-spacing: 1px; font-family: var(--font-display); }

.sidebar-nav { display: flex; flex-direction: column; padding: 8px 12px; gap: 2px; flex: 1; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 10px;
  color: #64748b; font-size: 14px; font-weight: 600;
  font-family: var(--font-display);
  transition: all 0.2s;
}
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(14,165,233,0.15); color: var(--blue-light); }
.sidebar-nav a.active { background: rgba(14,165,233,0.2); }

.sidebar-footer { padding: 16px 24px; border-top: 1px solid rgba(255,255,255,0.06); font-size: 13px; color: #334155; }

.admin-main { margin-left: 250px; flex: 1; min-height: 100vh; }

.admin-topbar {
  background: white; border-bottom: 1.5px solid #e2e8f0;
  padding: 20px 32px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
}
.admin-topbar h1 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; color: var(--navy); }

.btn-view-site {
  background: var(--blue-pale); color: var(--blue-dark);
  border: 1.5px solid var(--blue); padding: 8px 18px;
  border-radius: 8px; font-size: 13px; font-weight: 700;
  font-family: var(--font-display); transition: all 0.2s;
}
.btn-view-site:hover { background: var(--blue); color: white; }
.btn-back {
  background: #f1f5f9; color: var(--text-muted);
  padding: 8px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  font-family: var(--font-display); transition: all 0.2s;
}
.btn-back:hover { background: #e2e8f0; }
.btn-primary-sm {
  background: var(--blue); color: white;
  padding: 9px 20px; border-radius: 8px;
  font-size: 13px; font-weight: 700;
  font-family: var(--font-display); transition: all 0.2s;
}
.btn-primary-sm:hover { background: var(--blue-dark); }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 28px 32px; }
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: white; border: 1.5px solid #e2e8f0;
  border-radius: var(--radius); padding: 24px;
  text-align: center; box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card.blue { border-color: var(--blue); background: var(--blue-pale); }
.stat-card.coral { border-color: var(--coral); background: var(--coral-pale); }
.stat-card.green { border-color: #22c55e; background: #f0fdf4; }
.stat-card.purple { border-color: #8b5cf6; background: #f5f3ff; }
.stat-icon { font-size: 2rem; margin-bottom: 10px; }
.stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 900; color: var(--navy); }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }

/* TABLE */
.recent-products { padding: 0 32px 40px; }
.section-header-admin { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-header-admin h2 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; color: var(--navy); }

.admin-table-wrap { background: white; border-radius: var(--radius); border: 1.5px solid #e2e8f0; overflow: hidden; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { background: var(--navy); color: #64748b; padding: 14px 18px; text-align: left; font-family: var(--font-display); font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; white-space: nowrap; }
.admin-table td { padding: 14px 18px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--blue-pale); }

.table-product { display: flex; align-items: center; gap: 12px; }
.table-thumb { width: 50px; height: 50px; object-fit: cover; border-radius: 8px; border: 1px solid #e2e8f0; flex-shrink: 0; }

.badge { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; font-family: var(--font-display); }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-gray { background: #f1f5f9; color: #64748b; }

.table-actions { display: flex; gap: 6px; align-items: center; }
.btn-edit { padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 700; font-family: var(--font-display); background: var(--blue-pale); color: var(--blue-dark); transition: all 0.2s; }
.btn-edit:hover { background: var(--blue); color: white; }
.btn-delete { padding: 6px 10px; border-radius: 6px; font-size: 12px; background: #fee2e2; color: #dc2626; transition: all 0.2s; }
.btn-delete:hover { background: #dc2626; color: white; }
.btn-view { padding: 6px 10px; border-radius: 6px; font-size: 12px; background: #e0f2fe; color: #0369a1; transition: all 0.2s; }
.btn-view:hover { background: #0369a1; color: white; }

/* ALERTS */
.alert { padding: 14px 20px; border-radius: var(--radius-sm); margin: 0 32px 20px; font-size: 14px; font-weight: 500; font-family: var(--font-display); }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.alert-error { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }

/* PRODUCT FORM */
.product-form { padding: 28px 32px 40px; }
.form-grid { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .form-grid { grid-template-columns: 1fr; } }
.form-main, .form-sidebar { display: flex; flex-direction: column; gap: 20px; }

.form-card { background: white; border: 1.5px solid #e2e8f0; border-radius: var(--radius); padding: 24px; }
.form-card h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 800; color: var(--navy); margin-bottom: 18px; padding-bottom: 12px; border-bottom: 2px solid var(--blue-pale); }

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }
.form-group label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-family: var(--font-display); }
.form-group input, .form-group textarea, .form-group select {
  border: 1.5px solid #e2e8f0; border-radius: var(--radius-sm);
  padding: 11px 14px; font-family: var(--font-body); font-size: 14px;
  color: var(--text); background: #f8faff; transition: border-color 0.2s; outline: none;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--blue); background: white; }
.form-group textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }

/* FAQ ADMIN */
.faq-admin-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.faq-admin-item {
  background: var(--blue-pale);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  position: relative;
}
.faq-admin-item .form-group { margin-bottom: 8px; }
.faq-admin-item .form-group:last-child { margin-bottom: 0; }
.faq-remove-btn {
  position: absolute; top: 10px; right: 10px;
  background: #fee2e2; color: #dc2626;
  border: none; border-radius: 6px;
  padding: 4px 10px; font-size: 12px; cursor: pointer;
  font-family: var(--font-display); font-weight: 700;
  transition: all 0.2s;
}
.faq-remove-btn:hover { background: #dc2626; color: white; }
.btn-add-faq {
  display: flex; align-items: center; gap: 8px;
  background: var(--blue-pale); color: var(--blue-dark);
  border: 2px dashed var(--blue); border-radius: var(--radius-sm);
  padding: 12px; width: 100%; cursor: pointer;
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  transition: all 0.2s; justify-content: center;
}
.btn-add-faq:hover { background: var(--blue); color: white; border-style: solid; }

/* UPLOAD */
.upload-zone { border: 2px dashed var(--blue); border-radius: var(--radius); background: var(--blue-pale); text-align: center; cursor: pointer; transition: all 0.2s; overflow: hidden; }
.upload-zone:hover { background: #bae6fd; }
.upload-zone input[type="file"] { display: none; }
.upload-label { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 20px; cursor: pointer; color: var(--blue-dark); font-size: 14px; font-weight: 600; font-family: var(--font-display); }
.upload-icon { font-size: 2.5rem; }
.upload-label small { color: var(--text-muted); font-size: 12px; }
.image-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.image-previews img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; border: 1.5px solid var(--border); }
.existing-images { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.existing-img-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.existing-img-wrap img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; border: 1.5px solid var(--border); }
.keep-label { display: flex; align-items: center; gap: 4px; font-size: 11px; cursor: pointer; color: var(--text-muted); font-family: var(--font-display); }

/* TOGGLE */
.toggle-label { display: flex; align-items: center; gap: 10px; padding: 12px 0; cursor: pointer; border-bottom: 1px solid #f1f5f9; }
.toggle-label:last-child { border-bottom: none; }
.toggle-label input { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }
.toggle-text { font-size: 14px; font-weight: 600; font-family: var(--font-display); }

.btn-submit-full {
  display: block; width: 100%;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: white; border: none; padding: 16px;
  border-radius: var(--radius);
  font-family: var(--font-display); font-size: 16px; font-weight: 800;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 6px 24px rgba(14,165,233,0.35);
}
.btn-submit-full:hover { transform: translateY(-1px); box-shadow: 0 10px 32px rgba(14,165,233,0.45); }

/* Quill */
.ql-toolbar.ql-snow { border: 1.5px solid #e2e8f0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: #f8faff; }
.ql-container.ql-snow { border: 1.5px solid #e2e8f0; border-top: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm); font-family: var(--font-body); font-size: 15px; }

/* LOGIN */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--navy) 0%, #0c2340 100%); }
.login-wrapper { width: 100%; max-width: 440px; padding: 20px; }
.login-card { background: white; border-radius: 20px; padding: 44px; box-shadow: 0 24px 64px rgba(0,0,0,0.3); }
.login-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; justify-content: center; }
.login-logo strong { color: var(--blue); }
.login-logo .logo-icon { width: 42px; height: 42px; border-radius: 12px; }
.login-card h2 { font-family: var(--font-display); font-size: 1.2rem; text-align: center; margin-bottom: 6px; color: var(--navy); }
.login-sub { text-align: center; color: var(--text-muted); font-size: 14px; margin-bottom: 30px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.btn-login { background: linear-gradient(135deg, var(--blue), var(--blue-dark)); color: white; border: none; padding: 14px; border-radius: 10px; font-family: var(--font-display); font-size: 16px; font-weight: 800; cursor: pointer; transition: all 0.2s; margin-top: 8px; box-shadow: 0 4px 16px rgba(14,165,233,0.3); }
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(14,165,233,0.4); }
.back-link { display: block; text-align: center; margin-top: 20px; color: var(--text-muted); font-size: 14px; transition: color 0.2s; font-family: var(--font-display); }
.back-link:hover { color: var(--blue); }

/* RESPONSIVE ADMIN */
@media (max-width: 768px) {
  .admin-sidebar { display: none; }
  .admin-main { margin-left: 0; }
  .product-form, .recent-products, .stats-grid { padding-left: 16px; padding-right: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); padding: 16px; }
}
