
:root {
  --bg: #f7f7f8;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --brand: #8b5cf6; /* ungu lembut */
  --brand-dark: #6d28d9;
  --danger: #ef4444;
  /* Theme-aware fallbacks (overridden by assets/css/style.css) */
  --text-color: #1f2937;
  --text-muted: rgba(31,41,55,0.68);
}

* { box-sizing: border-box; }
body {
  margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-color, var(--text)); background: var(--bg);
}
.container { max-width: 1100px; margin: 0 auto; padding: 16px; }

.footer {
  width: 100%;
  text-align: center;
  padding: 32px 0 24px 0;
  color: var(--muted);
  font-size: 16px;
  background: var(--bg);
  margin-top: 80px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}
.footer-brand {
  font-weight: 700;
  color: var(--brand);
}
.nav {
  display:flex; align-items:center; justify-content:space-between; padding:14px 0;
}
.brand { font-weight: 800; font-size: 22px; letter-spacing: .4px; color: var(--brand); }
.nav a { text-decoration:none; color: var(--text-color, var(--text)); margin-left: 12px; }
.nav .cart-pill { background: var(--brand); color: white; padding: 6px 10px; border-radius: 999px; font-size: 14px; }

.grid {
  display:grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card); border-radius: 14px; padding: 14px; box-shadow: 0 8px 20px rgba(0,0,0,.05);
  display:flex; flex-direction:column; color: var(--text-color, var(--text));
}
.card img { width:100%; height:210px; object-fit:cover; border-radius: 10px; background:#eee; }
.card h3 { margin:10px 0 6px; font-size: 18px; color: var(--text-color, var(--text)); }
.price { font-weight:700; margin:4px 0 10px; color: var(--text-color, var(--text)); }
.btn {
  display:inline-block; padding:10px 14px; border-radius: 10px; text-decoration:none; border:none; cursor:pointer;
  background: var(--brand); color:white; font-weight:600;
}
.btn:hover { background: var(--brand-dark); }
.btn-outline { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
.btn-danger { background: var(--danger); }
.badge { display:inline-block; background:#f3f4f6; padding:6px 10px; border-radius: 999px; font-size:12px; color:var(--muted); }

header.hero {
  background: linear-gradient(180deg, rgba(139,92,246,.12), transparent);
  border-bottom: 1px solid #eee;
}
.hero h1 { margin: 12px 0 4px; font-size: 28px; color: var(--text-color, var(--text)); }
.hero p { color: var(--text-muted, var(--muted)); margin-top: 0; }

.table { width:100%; border-collapse: collapse; color: var(--text-color, var(--text)); }
.table th, .table td { padding: 10px; border-bottom: 1px solid #eee; text-align:left; color: var(--text-color, var(--text)); }
.table th { background:#fafafa; }

.form { display:grid; gap: 12px; }
.input, .select, .file {
  width:100%; padding:10px; border:1px solid #e5e7eb; border-radius:10px; background:white; color: var(--text-color, var(--text));
}
.input::placeholder { color: var(--text-muted, rgba(31,41,55,0.5)); }
label { font-weight:600; font-size:14px; color: var(--text-color, #374151); }

.footer { margin: 40px 0 20px; color: var(--muted); font-size: 14px; text-align:center; }

/* Sticky footer layout: make body a column so footer sits at the bottom
  even when page content is short. Pages use <main class="container"> so
  set main to grow to fill available space. */
html, body { height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1 0 auto; }
.footer { margin-top: auto; width: 100%; }

/* Ensure container-based footers still center correctly */
.container.footer { display:flex; justify-content:center; align-items:center; padding:18px 16px; color: var(--text-color, var(--text)); }

/* Theme-aware text elements for all pages */
h1, h2, h3, h4, h5, h6 { color: var(--text-color, var(--text)); }
strong { color: var(--text-color, var(--text)); }
li { color: var(--text-color, var(--text)); }

/* Ensure readable text over backgrounds (surface & contrast helpers) */
:root {
  --surface-strong: rgba(255,255,255,0.92);
  --surface-weak: rgba(255,255,255,0.72);
}

/* Surface fallback for pages that include only `styles.css` */
.surface {
  background: var(--surface-strong);
  color: var(--text-color, var(--text));
  border: 1px solid rgba(0,0,0,0.06);
  color: var(--text);
  padding: 14px;
  border-radius: 12px;
}

/* Strong text utility to force high contrast on busy backgrounds */
.text-contrast { color: var(--text) !important; text-shadow: 0 1px 0 rgba(255,255,255,0.6); }

/* Make headings more legible on image-backed pages */
h1, h2, h3 { color: var(--text); text-shadow: 0 1px 0 rgba(255,255,255,0.6); }

/* Nav links: increase contrast and add subtle background on admin image pages */
.nav a { color: var(--text); }
body.admin-dashboard .nav a { color: rgba(15,23,42,0.85); }

/* Buttons: ensure readable label on all themes */
.btn, .btn-primary, .btn-outline { color: #fff; }
.btn-outline { color: var(--brand); }

/* Adjust muted color for better contrast on lighter overlays */
:root { --muted: #6b7280; }
body.admin-dashboard { --muted: rgba(15,23,42,0.6); }
