/* ============================================================
   STERLUX SOLUTIONS — Admin CMS Dashboard Styles
   Minimalistic Green, Blue & White Design System with Material Design Icons
   ============================================================ */

:root {
  /* Core Minimalist Color Palette */
  --bg-page: #f4f6fb;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-hover: #f8fafc;
  
  --border-color: #e2e8f0;
  --border-focus: #2563eb;
  --ring-focus: rgba(37, 99, 235, 0.15);

  /* Primary Blue Palette */
  --blue-primary: #1d4ed8;
  --blue-hover: #1e40af;
  --blue-light: #eff6ff;
  --blue-text: #1e3a8a;
  --blue-dark: #0f172a;

  /* Emerald / Mint Green Palette */
  --green-primary: #059669;
  --green-hover: #047857;
  --green-light: #ecfdf5;
  --green-text: #065f46;
  --green-border: #a7f3d0;

  /* Neutrals & Text */
  --text-main: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  /* Semantic Alerts */
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --danger-text: #991b1b;
  --amber: #d97706;
  --amber-light: #fffbeb;

  /* Radii & Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 30px -4px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* Material Symbols Standard Utility */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-page);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ============================================================
   AUTH / LOGIN SCREEN (MINIMALISTIC WHITE / BLUE / GREEN)
   ============================================================ */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 50%, #f8fafc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 44px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue-primary), var(--green-primary));
}

.auth-logo {
  height: 64px;
  margin-bottom: 18px;
  object-fit: contain;
}

.auth-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 26px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-body);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap input,
.input-wrap textarea,
.input-wrap select,
.form-input {
  width: 100%;
  padding: 11px 15px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all var(--transition);
  outline: none;
}

.input-wrap input:focus,
.input-wrap textarea:focus,
.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--ring-focus);
}

.input-toggle-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.input-toggle-btn:hover { color: var(--blue-primary); }

.auth-notice {
  font-size: 0.82rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  display: none;
  font-weight: 600;
}
.auth-notice.error {
  display: block;
  background: var(--danger-light);
  color: var(--danger-text);
  border: 1px solid #fecaca;
}
.auth-notice.info {
  display: block;
  background: var(--green-light);
  color: var(--green-text);
  border: 1px solid var(--green-border);
}

/* ============================================================
   BUTTONS (MINIMALIST BLUE & GREEN)
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--blue-primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.2);
}
.btn-primary:hover {
  background: var(--blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3);
}

.btn-success {
  background: var(--green-primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.2);
}
.btn-success:hover {
  background: var(--green-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-ghost {
  background: #ffffff;
  color: var(--text-body);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xs);
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--blue-primary);
  border-color: #cbd5e1;
}

.btn-danger {
  background: #fee2e2;
  color: var(--danger-text);
  border: 1px solid #fca5a5;
}
.btn-danger:hover {
  background: var(--danger);
  color: #ffffff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  gap: 5px;
}

.btn-full {
  width: 100%;
}

/* ============================================================
   MAIN APP LAYOUT
   ============================================================ */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-header {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  height: 38px;
  object-fit: contain;
}

.sidebar-title h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blue-dark);
}
.sidebar-title span {
  font-size: 0.7rem;
  color: var(--green-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.sidebar-nav {
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
}

.nav-item:hover {
  background: var(--blue-light);
  color: var(--blue-primary);
}

.nav-item.active {
  background: var(--blue-light);
  color: var(--blue-primary);
  font-weight: 700;
}

.nav-item .material-symbols-outlined {
  color: var(--text-muted);
  transition: color var(--transition);
}

.nav-item:hover .material-symbols-outlined,
.nav-item.active .material-symbols-outlined {
  color: var(--blue-primary);
}

.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafbfc;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.user-meta strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text-main);
}
.user-meta span {
  font-size: 0.72rem;
  color: var(--green-primary);
  font-weight: 600;
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-page);
}

.app-topbar {
  padding: 14px 32px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-left h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

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

.app-body {
  padding: 32px;
  flex: 1;
  max-width: 1300px;
  width: 100%;
}

/* Tabs */
.tab-pane {
  display: none;
  animation: fadeIn 0.2s ease;
}
.tab-pane.active {
  display: block;
}

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

/* ============================================================
   MINIMALIST CARDS & GRIDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-icon.blue  { background: var(--blue-light); color: var(--blue-primary); }
.stat-icon.green { background: var(--green-light); color: var(--green-primary); }
.stat-icon.amber { background: var(--amber-light); color: var(--amber); }

.stat-details span {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}
.stat-details h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Section Box */
.section-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.section-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.section-box-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-box-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Grid Layouts */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

/* Items List / Cards */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.item-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--transition);
  box-shadow: var(--shadow-xs);
}

.item-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.item-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.item-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.item-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--blue-light);
  color: var(--blue-text);
  border: 1px solid #bfdbfe;
}

.item-card-thumb {
  height: 140px;
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f1f5f9;
}
.item-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-card-desc {
  font-size: 0.85rem;
  color: var(--text-body);
  line-height: 1.45;
  flex: 1;
}

.item-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

/* Accordion FAQs in Admin */
.admin-faq-item {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-xs);
}

.admin-faq-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-faq-question {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.admin-faq-answer {
  font-size: 0.875rem;
  color: var(--text-body);
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

.modal-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafbfc;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { color: var(--danger); }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: #fafbfc;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-main);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  animation: slideToast 0.3s ease;
  min-width: 260px;
}

.toast.success {
  border-color: var(--green-border);
  background: var(--green-light);
  color: var(--green-text);
}

.toast.error {
  border-color: #fecaca;
  background: var(--danger-light);
  color: var(--danger-text);
}

@keyframes slideToast {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .app-sidebar {
    width: 70px;
  }
  .sidebar-header .sidebar-title,
  .nav-item span:not(.material-symbols-outlined),
  .user-meta {
    display: none;
  }
  .sidebar-nav {
    padding: 16px 8px;
  }
  .nav-item {
    justify-content: center;
    padding: 12px;
  }
  .form-grid-2, .form-grid-3 {
    grid-template-columns: 1fr;
  }
  .app-body {
    padding: 20px;
  }
}

/* ============================================================
   IMAGE UPLOAD & PREVIEW
   ============================================================ */
.image-upload-zone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 22px 16px;
  background: #f8fafc;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.image-upload-zone:hover,
.image-upload-zone.dragover {
  border-color: var(--blue-primary);
  background: var(--blue-light);
}

.image-upload-zone .material-symbols-outlined {
  font-size: 36px;
  color: var(--blue-primary);
}

.image-upload-zone strong {
  font-size: 0.9rem;
  color: var(--text-main);
}

.image-upload-zone span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.image-preview-container {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.image-preview-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #e2e8f0;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.image-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-info {
  flex: 1;
  min-width: 0;
}

.image-preview-info span {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  word-break: break-all;
}

.image-preview-info strong {
  display: block;
  font-size: 0.85rem;
  color: var(--green-primary);
}

