/* DigitalFlow Admin Styles */

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

/* SIDEBAR */
.admin-sidebar {
  width: 248px; background: var(--slate-2); color: white;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 200; overflow-y: auto;
}
.sidebar-header {
  padding: 28px 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 700;
}
.sidebar-logo strong { color: var(--terra-light); }
.sidebar-logo .logo-mark { width: 32px; height: 32px; border-radius: 8px; font-size: 1rem; }
.sidebar-tag { font-size: 10px; color: #475569; text-transform: uppercase; letter-spacing: 2px; margin-top: 8px; font-weight: 500; }

.sidebar-nav { display: flex; flex-direction: column; padding: 12px 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: 500;
  transition: all 0.2s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(200,113,74,0.15); color: var(--terra-light);
}

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

/* MAIN */
.admin-main { margin-left: 248px; flex: 1; min-height: 100vh; }

.admin-topbar {
  background: white; border-bottom: 1px solid #e8e0d4;
  padding: 20px 32px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.admin-topbar h1 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--slate-2); letter-spacing: -0.2px; }

.btn-view-site { background: var(--beige-dark); color: var(--slate); border: 1px solid var(--border); padding: 8px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; transition: all 0.2s; }
.btn-view-site:hover { background: var(--terra); color: white; border-color: var(--terra); }
.btn-back { background: #f0ebe3; color: var(--text-muted); padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; transition: all 0.2s; }
.btn-back:hover { background: var(--border); }
.btn-primary-sm { background: var(--terra); color: white; padding: 9px 20px; border-radius: 8px; font-size: 13px; font-weight: 600; transition: all 0.2s; }
.btn-primary-sm:hover { background: var(--terra-dark); }

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

.stat-card { background: white; border: 1px solid #e8e0d4; border-radius: var(--radius); padding: 24px; text-align: center; transition: transform 0.2s, box-shadow 0.2s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(45,55,72,0.08); }
.stat-card.terra { border-color: var(--terra-light); background: var(--terra-pale); }
.stat-card.olive { border-color: var(--olive-light); background: var(--olive-pale); }
.stat-card.slate { border-color: #94a3b8; background: var(--slate-pale); }
.stat-card.sand  { border-color: var(--sand-dark); background: var(--beige); }
.stat-icon { font-size: 2rem; margin-bottom: 10px; }
.stat-value { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; color: var(--slate-2); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.8px; }

/* 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: 600; color: var(--slate-2); }

.admin-table-wrap { background: white; border-radius: var(--radius); border: 1px solid #e8e0d4; overflow: hidden; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { background: var(--slate-2); color: #64748b; padding: 13px 18px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; white-space: nowrap; font-weight: 600; }
.admin-table td { padding: 14px 18px; border-bottom: 1px solid #f7f4ef; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #ffffff; }

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

.badge { padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: 0.3px; }
.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: 600; background: var(--beige-dark); color: var(--slate); transition: all 0.2s; }
.btn-edit:hover   { background: var(--terra); 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: var(--slate-pale); color: var(--slate); transition: all 0.2s; }
.btn-view:hover   { background: var(--slate); color: white; }

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

/* 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: 1px solid #e8e0d4; border-radius: var(--radius); padding: 26px; }
.form-card h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--slate-2); margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border-light); letter-spacing: -0.1px; }

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }
.form-group label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; }
.form-group input, .form-group textarea, .form-group select {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 14px; font-family: var(--font-body); font-size: 14px;
  color: var(--text); background: #ffffff; transition: border-color 0.2s, box-shadow 0.2s; outline: none;
}
.form-group input:focus, .form-group textarea:focus {
  border-color: var(--terra);
  box-shadow: 0 0 0 3px rgba(200,113,74,0.1);
  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.55; font-weight: 300; }

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

/* UPLOAD */
.upload-zone { border: 1.5px dashed var(--sand-dark); border-radius: var(--radius); background: #ffffff; text-align: center; cursor: pointer; transition: all 0.2s; overflow: hidden; }
.upload-zone:hover { background: var(--beige-dark); border-color: var(--terra); }
.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(--text-muted); font-size: 14px; font-weight: 500; }
.upload-icon { font-size: 2.4rem; }
.upload-label small { color: var(--sand-dark); font-size: 12px; }
.image-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.image-previews img { width: 68px; height: 68px; object-fit: cover; border-radius: 8px; border: 1px 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: 68px; height: 68px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.keep-label { display: flex; align-items: center; gap: 4px; font-size: 11px; cursor: pointer; color: var(--text-muted); }

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

.btn-submit-full { display: block; width: 100%; background: var(--terra); color: white; border: none; padding: 16px; border-radius: var(--radius); font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 16px rgba(245,194,0,0.3); letter-spacing: 0.2px; }
.btn-submit-full:hover { background: var(--terra-dark); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(245,194,0,0.4); }

/* Quill */
.ql-toolbar.ql-snow { border: 1px solid var(--border); border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: #ffffff; }
.ql-container.ql-snow { border: 1px solid var(--border); 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: var(--slate-2); }
.login-wrapper { width: 100%; max-width: 420px; padding: 20px; }
.login-card { background: #ffffff; border-radius: 20px; padding: 44px; box-shadow: 0 24px 60px rgba(0,0,0,0.3); border: 1px solid var(--border); }
.login-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; justify-content: center; }
.login-logo strong { color: var(--terra); }
.login-logo .logo-mark { width: 42px; height: 42px; border-radius: 12px; font-size: 1.1rem; }
.login-card h2 { font-family: var(--font-display); font-size: 1.2rem; text-align: center; margin-bottom: 6px; color: var(--slate-2); font-weight: 600; }
.login-sub { text-align: center; color: var(--text-muted); font-size: 14px; margin-bottom: 32px; font-weight: 300; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.btn-login { background: var(--terra); color: white; border: none; padding: 14px; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s; margin-top: 8px; box-shadow: 0 4px 16px rgba(245,194,0,0.3); }
.btn-login:hover { background: var(--terra-dark); transform: translateY(-1px); }
.back-link { display: block; text-align: center; margin-top: 20px; color: var(--text-muted); font-size: 14px; transition: color 0.2s; }
.back-link:hover { color: var(--terra); }

@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; }
}
