:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #f5f5f5;
  --muted-fg: #737373;
  --border: #e5e5e5;
  --primary: #171717;
  --primary-fg: #fafafa;
  --ring: #a3a3a3;
  --radius: 10px;
  --emerald: #047857;
  --emerald-bg: #ecfdf5;
  --amber: #b45309;
  --amber-bg: #fffbeb;
  --red: #b91c1c;
  --red-bg: #fef2f2;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-size: 15px;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { letter-spacing: -0.01em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; }

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.muted { color: var(--muted-fg); }
.center { text-align: center; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }
main { flex: 1; }

/* Header / footer */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); }
.site-header .container { height: 56px; display: flex; align-items: center; justify-content: space-between; }
.nav { display: flex; align-items: center; gap: 6px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: rgba(4,120,87,0.12); color: var(--emerald); }
.brand-mark svg { width: 16px; height: 16px; }

.site-footer { margin-top: auto; border-top: 1px solid var(--border); background: var(--muted); }
.site-footer .container { padding: 40px 16px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-grid h4 { font-size: 14px; margin: 0 0 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; color: var(--muted-fg); }
.footer-grid a:hover { color: var(--fg); }
.copyright { margin-top: 36px; border-top: 1px solid var(--border); padding-top: 20px; color: var(--muted-fg); font-size: 14px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: var(--radius); border: 1px solid transparent; background: var(--primary); color: var(--primary-fg); font-size: 14px; font-weight: 500; cursor: pointer; transition: opacity .15s, background .15s; }
.btn:hover { opacity: 0.85; }
.btn-outline { background: var(--bg); color: var(--fg); border-color: var(--border); }
.btn-outline:hover { background: var(--muted); opacity: 1; }
.btn-ghost { background: transparent; color: var(--fg); }
.btn-ghost:hover { background: var(--muted); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-success { background: var(--emerald); color: #fff; }
.btn svg { width: 16px; height: 16px; }

/* Inputs */
.input, .textarea, select { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 12px; font-size: 14px; background: var(--bg); color: var(--fg); font-family: inherit; }
.input:focus, .textarea:focus, select:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px rgba(163,163,163,0.25); }
.textarea { min-height: 90px; resize: vertical; }
label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.help { font-size: 13px; color: var(--muted-fg); margin-top: 6px; }

/* Cards */
.card { border: 1px solid var(--border); border-radius: 14px; background: var(--bg); padding: 20px; }
.card h3 { margin: 0 0 6px; font-size: 17px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.badge svg { width: 13px; height: 13px; }
.badge-green { background: var(--emerald-bg); color: var(--emerald); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-muted { background: var(--muted); color: var(--muted-fg); }

/* Hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); background: #fafafa; }
.hero .container { padding: 80px 16px; text-align: center; }
.hero h1 { font-size: 44px; line-height: 1.1; margin: 0 auto; max-width: 720px; }
.hero p.lead { font-size: 18px; color: var(--muted-fg); max-width: 620px; margin: 16px auto 0; }
.pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--bg); border-radius: 999px; padding: 5px 12px; font-size: 14px; color: var(--muted-fg); }
.feather-bg { position: absolute; color: rgba(4,120,87,0.05); pointer-events: none; }

/* Search */
.search { display: flex; gap: 8px; max-width: 440px; margin: 32px auto 0; }
.search .input { flex: 1; }

/* Table */
.table-wrap { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.table th { text-align: left; padding: 12px 16px; background: var(--muted); font-weight: 500; color: var(--muted-fg); }
table.table td { padding: 12px 16px; border-top: 1px solid var(--border); }
.thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); background: var(--muted); }

/* Gallery */
.gallery-main { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 14px; border: 1px solid var(--border); background: var(--muted); }
.gallery-thumbs { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-top: 12px; }
.gallery-thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

/* Alerts */
.alert { border-radius: var(--radius); padding: 12px 14px; font-size: 14px; margin-bottom: 16px; border: 1px solid var(--border); }
.alert-error { background: var(--red-bg); color: var(--red); border-color: transparent; }
.alert-success { background: var(--emerald-bg); color: var(--emerald); border-color: transparent; }
.alert-info { background: var(--muted); color: var(--fg); }

/* Notifications dropdown */
.notif { position: relative; }
.notif > summary { cursor: pointer; list-style: none; }
.notif > summary::-webkit-details-marker { display: none; }
.notif-count { background: var(--red); color: #fff; border-radius: 999px; font-size: 10px; padding: 0 5px; margin-left: 3px; }
.notif-menu { position: absolute; right: 0; top: 115%; width: 300px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); z-index: 50; overflow: hidden; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.notif-item { display: block; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--muted); }
.notif-item.unread { background: rgba(4,120,87,.06); }
.notif-empty { padding: 18px; text-align: center; }

.auth-wrap { max-width: 380px; margin: 48px auto; padding: 0 16px; }
.dashboard { max-width: 1100px; margin: 0 auto; padding: 40px 16px; }

@media (max-width: 768px) {
  .grid-3, .grid-2, .footer-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
}
@media print {
  .site-header, .site-footer, .no-print { display: none !important; }
}
