/* iadoc — clean modern theme */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ink: #1f2a37;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #1f7a5c;        /* agriculture / water green */
  --brand-dark: #14513c;
  --brand-soft: #e7f3ee;
  --accent: #2563eb;
  --danger: #dc2626;
  --warn: #b45309;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 10px 30px rgba(16,24,40,.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PT Sans", "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Layout ---- */
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.page { padding: 32px 0 64px; }
.page-narrow { max-width: 560px; }

/* ---- Header ---- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header .container { display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 8px 20px; max-width: 1320px; }
.brand { display: flex; flex-direction: column; line-height: 1.2; }
.brand b { font-size: 1.05rem; color: var(--brand-dark); font-weight: 700; }
.brand span { font-size: .72rem; color: var(--muted); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--ink); padding: 8px 12px; border-radius: 8px;
  font-size: .92rem; font-weight: 500; white-space: nowrap;
}
.nav a:hover { background: var(--brand-soft); text-decoration: none; color: var(--brand-dark); }
.nav a.active { background: var(--brand); color: #fff; }
.nav .pill { background: var(--brand); color:#fff; }
.nav .pill:hover { background: var(--brand-dark); color:#fff; }
.nav .ghost { color: var(--muted); }

/* Hamburger toggle (CSS-only, no JS) */
.nav-toggle { display: none; }
.nav-burger {
  margin-left: auto; display: none; cursor: pointer; user-select: none;
  font-size: 1.5rem; line-height: 1; padding: 6px 10px; border-radius: 8px;
  color: var(--brand-dark);
}
.nav-burger:hover { background: var(--brand-soft); }

@media (max-width: 1100px) {
  .site-header .container { flex-wrap: wrap; }
  .nav-burger { display: inline-flex; }
  .nav {
    margin-left: 0; flex-basis: 100%; flex-direction: column;
    align-items: stretch; gap: 2px; display: none; padding-bottom: 8px;
  }
  .nav-toggle:checked ~ .nav { display: flex; }
  .nav a { padding: 10px 12px; border-radius: 8px; }
}

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff; padding: 64px 0;
}
.hero h1 { margin: 0 0 12px; font-size: 2rem; font-weight: 700; }
.hero p { margin: 0; opacity: .92; max-width: 640px; }
.hero .cta { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ---- Cards ---- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
}
.card + .card { margin-top: 20px; }
.card h2 { margin: 0 0 4px; font-size: 1.2rem; }
.card .sub { color: var(--muted); font-size: .9rem; margin-bottom: 18px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 820px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* dashboard tiles */
.tile {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}
a.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; }
.tile .label { color: var(--muted); font-size: .88rem; }
.tile .value { font-size: 1.9rem; font-weight: 700; color: var(--brand-dark); }
.tile .icon { font-size: 1.4rem; }
.tile.action { background: var(--brand-soft); border-color: #cfe6dc; }
.tile.action .title { font-weight: 600; color: var(--brand-dark); font-size: 1.05rem; }
.tile.action .desc { color: var(--muted); font-size: .86rem; }

/* ---- Section heading ---- */
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 0 0 20px; }
.section-title h1 { font-size: 1.5rem; margin: 0; }
.section-title .crumb { color: var(--muted); font-size: .9rem; }

/* ---- Forms ---- */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: .95rem; background: #fff; color: var(--ink);
}
.form-control:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.form-control { resize: vertical; }
.form-check { display: flex; align-items: center; gap: 8px; }
.help { color: var(--muted); font-size: .82rem; margin-top: 4px; }
.errorlist { list-style: none; margin: 6px 0 0; padding: 0; color: var(--danger); font-size: .85rem; }
.field-error { color: var(--danger); font-size: .85rem; margin-top: 4px; }
.captcha-row { display: flex; gap: 12px; align-items: flex-start; }
.captcha-row img { height: 48px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
  font-size: .95rem; font-weight: 600; cursor: pointer; background: var(--brand); color: #fff;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; color:#fff; }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: #f3f4f6; color: var(--ink); }
.btn.outline-light { background: rgba(255,255,255,.12); color:#fff; border-color: rgba(255,255,255,.5); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #b91c1c; }
.btn.sm { padding: 6px 12px; font-size: .85rem; }
.btn.block { width: 100%; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .92rem; }
table.data th, table.data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
table.data th { background: #f9fafb; color: var(--muted); font-weight: 600; white-space: nowrap; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #fcfdfe; }

/* ---- Badges / messages ---- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge.green { background: var(--brand-soft); color: var(--brand-dark); }
.badge.amber { background: #fef3c7; color: var(--warn); }
.badge.red { background: #fee2e2; color: var(--danger); }
.badge.gray { background: #f3f4f6; color: var(--muted); }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 14px; font-size: .92rem; border: 1px solid transparent; }
.alert.success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert.error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert.info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.alert.warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }

/* ---- Misc ---- */
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.list-news { list-style: none; margin: 0; padding: 0; }
.list-news li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.list-news li:last-child { border-bottom: none; }
.list-news .date { color: var(--muted); font-size: .82rem; }
.inline { display: inline; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; } .kv dt { margin-top: 8px; } }

/* ---- Footer ---- */
.site-footer { background: #0f231b; color: #cbd5d1; padding: 28px 0; font-size: .85rem; }
.site-footer a { color: #a7d3c2; }
.site-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer .visit-count { display: inline-block; margin-top: 6px; color: #8fb3a6; font-size: .8rem; }
