/* =====================================================================
   ระบบแฟ้มสะสมผลงานนักเรียน — สไตล์มินิมอล โทนสีน้ำเงินตามรูปตัวอย่าง
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Thai:wght@300;400;500;600;700&display=swap');

:root {
  /* โทนสีจากรูป (น้ำเงินเข้มสุด -> ฟ้าอ่อนสุด) */
  --navy:      #0d47a1;   /* จากรูป 988 น้ำเงินเข้ม */
  --blue:      #1e88e5;   /* น้ำเงินสด */
  --blue-mid:  #90caf9;   /* ฟ้ากลาง */
  --blue-soft: #e3f2fd;   /* ฟ้าอ่อนมาก (พื้นหลัง) */
  --slate:     #35576f;   /* จากรูป 990 น้ำเงินอมเทา */
  --slate-mid: #7aa8cc;
  --sky:       #9dd4ff;
  --cream:     #f6f7f0;   /* ครีมอ่อนจากรูป 990 */

  --ink:       #1b2430;
  --muted:     #5b6b7b;
  --line:      #e2e8f0;
  --white:     #ffffff;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 2px 10px rgba(13, 71, 161, .08);
  --shadow-lg: 0 8px 30px rgba(13, 71, 161, .12);
  --font: 'IBM Plex Sans Thai', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font);
  font-weight: 400;
  color: var(--ink);
  background: var(--blue-soft);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* จัด layout ให้ footer ชิดล่างเสมอ (sticky footer) */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
/* ให้ส่วนเนื้อหาหลักดันฟุตเตอร์ลงล่างเมื่อเนื้อหาสั้น */
body > .section:last-of-type,
body > .container { }
.site-footer { margin-top: auto; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--navy);
  color: #cfe4ff;
  font-size: .82rem;
}
.topbar .container {
  display: flex; justify-content: space-between; align-items: center;
  height: 38px;
}
.topbar a { color: #fff; font-weight: 500; }

/* ---------- Header / Nav ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo {
  width: 42px; height: 42px; border-radius: 10px;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 1.1rem;
}
.brand b { font-size: 1.02rem; font-weight: 600; color: var(--ink); display: block; }
.brand span { font-size: .76rem; color: var(--muted); font-weight: 300; }

.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
  color: var(--ink); font-size: .9rem; font-weight: 500;
  padding: 8px 14px; border-radius: 8px; text-decoration: none;
}
.nav a:hover { background: var(--blue-soft); color: var(--navy); }
.nav a.active { background: var(--navy); color: #fff; }
.burger { display: none; font-size: 1.6rem; line-height: 1; background: none; border: 0;
  color: var(--navy); cursor: pointer; padding: 4px 8px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 9px; border: 0;
  font-family: var(--font); font-weight: 600; font-size: .9rem;
  cursor: pointer; text-decoration: none; transition: .15s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--navy); text-decoration: none; }
.btn-ghost { background: var(--blue-soft); color: var(--navy); }
.btn-ghost:hover { background: var(--blue-mid); text-decoration: none; }
.btn-slate { background: var(--slate); color: #fff; }
.btn-slate:hover { background: #294455; text-decoration: none; }
.btn-danger { background: #e53935; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .82rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 55%, var(--slate-mid) 100%);
  color: #fff; padding: 60px 0;
}
.hero .container { max-width: 780px; text-align: center; }
.hero .kicker {
  display: inline-block; background: rgba(255,255,255,.15);
  padding: 5px 14px; border-radius: 20px; font-size: .8rem; margin-bottom: 16px;
}
.hero h1 { font-size: 2.4rem; font-weight: 700; margin-bottom: 12px; letter-spacing: -.5px; }
.hero p { font-size: 1.05rem; font-weight: 300; opacity: .95; margin-bottom: 26px; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Sections ---------- */
.section { padding: 46px 0; }
.section-label {
  color: var(--blue); font-weight: 600; font-size: .82rem;
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px;
}
.section h2 { font-size: 1.6rem; font-weight: 600; margin-bottom: 6px; }
.section .lead { color: var(--muted); font-weight: 300; margin-bottom: 26px; }

/* ---------- Cards grid ---------- */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  transition: .18s;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card .tag {
  display: inline-block; background: var(--blue-soft); color: var(--navy);
  font-size: .74rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; margin-bottom: 10px;
}
.card h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 6px; }
.card p { color: var(--muted); font-size: .9rem; font-weight: 300; }

/* ---------- Stat cards ---------- */
.stat {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; text-align: center; box-shadow: var(--shadow);
}
.stat .num { font-size: 2rem; font-weight: 700; color: var(--navy); }
.stat .lbl { color: var(--muted); font-size: .86rem; font-weight: 300; }

/* ---------- Forms ---------- */
.form-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); max-width: 100%;
}
.form-row { display: grid; gap: 16px; margin-bottom: 16px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.field label {
  display: block; font-size: .86rem; font-weight: 500; margin-bottom: 6px; color: var(--ink);
}
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-family: var(--font); font-size: .92rem;
  background: #fbfcfe; transition: .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--blue); background: #fff;
  box-shadow: 0 0 0 3px rgba(30,136,229,.12);
}
.field textarea { resize: vertical; min-height: 80px; }
.fieldset-title {
  font-weight: 600; color: var(--navy); font-size: 1rem;
  margin: 26px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--blue-soft);
}
.fieldset-title:first-child { margin-top: 0; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(135deg, var(--navy), var(--slate)); }
.auth-box {
  background: #fff; border-radius: 18px; padding: 36px; width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.auth-box h1 { font-size: 1.4rem; text-align: center; margin-bottom: 4px; }
.auth-box .sub { text-align: center; color: var(--muted); font-size: .88rem; margin-bottom: 24px; font-weight: 300; }

/* ---------- Table ---------- */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th { background: var(--navy); color: #fff; font-weight: 500; font-size: .85rem; padding: 12px 14px; text-align: left; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.table tr:hover td { background: var(--blue-soft); }

/* ---------- Alert ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: .9rem; }
.alert-ok { background: #e6f4ea; color: #1b5e20; border: 1px solid #a5d6a7; }
.alert-err { background: #fdecea; color: #b71c1c; border: 1px solid #ef9a9a; }
.alert-info { background: var(--blue-soft); color: var(--navy); border: 1px solid var(--blue-mid); }

/* ---------- Term pills ---------- */
.term-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.term-tabs a {
  padding: 8px 16px; border-radius: 20px; background: #fff; border: 1px solid var(--line);
  font-size: .86rem; font-weight: 500; color: var(--muted); text-decoration: none;
}
.term-tabs a.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.term-tabs a.open::after { content: '● เปิด'; color: #2e7d32; font-size: .7rem; margin-left: 6px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #cfe0f5; padding: 22px 0; margin-top: auto; }
.site-footer .copy { font-size: .8rem; text-align: center; }

/* ---------- Profile view ---------- */
.profile-head { display: flex; gap: 24px; align-items: center; }
.profile-photo {
  width: 120px; height: 150px; border-radius: 10px; object-fit: cover;
  border: 3px solid var(--white); box-shadow: var(--shadow); background: var(--blue-soft);
}
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 30px; }
.info-item { display: flex; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.info-item .k { color: var(--muted); min-width: 140px; font-weight: 300; }
.info-item .v { font-weight: 500; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .container { padding: 0 14px; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .site-footer .cols { grid-template-columns: 1fr; }

  .hero { padding: 40px 0; }
  .hero h1 { font-size: 1.7rem; }
  .hero p { font-size: .96rem; }
  .section { padding: 32px 0; }
  .section h2 { font-size: 1.35rem; }
  .profile-head { flex-direction: column; text-align: center; }
  .form-card { padding: 18px; }

  /* hamburger dropdown nav */
  .burger { display: block; }
  .site-header .container { position: relative; }
  .nav {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    background: #fff; flex-direction: column; gap: 2px; padding: 8px;
    box-shadow: var(--shadow-lg); border-bottom: 1px solid var(--line); z-index: 60;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; font-size: .95rem; }

  /* tables scroll horizontally on small screens */
  .table { display: block; overflow-x: auto; white-space: nowrap; }
}
/* touch-friendly tap targets */
@media (max-width: 760px) {
  .btn { padding: 12px 18px; }
  .btn-sm { padding: 8px 13px; }
  .field input, .field select, .field textarea { font-size: 16px; } /* กัน iOS ซูมอัตโนมัติ */
}

/* ---------- Gallery (รูปกิจกรรม/เกียรติบัตร/ผลงาน) ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
.gallery-item {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: #fff; box-shadow: var(--shadow);
}
.gallery-item .thumb {
  width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block;
  background: linear-gradient(135deg, var(--blue-soft), var(--blue-mid));
}
.gallery-item .meta { padding: 11px 13px; }
.gallery-item .meta .k-type {
  font-size: .7rem; font-weight: 600; color: var(--blue);
  text-transform: uppercase; letter-spacing: .5px;
}
.gallery-item .meta b { display: block; font-size: .92rem; margin: 2px 0; }
.gallery-item .meta p { font-size: .8rem; color: var(--muted); font-weight: 300; }
.gallery-item .meta .del { margin-top: 8px; }

/* print gallery: 2 คอลัมน์ต่อแถว มีรูป+รายละเอียด */
.print-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.print-gallery .pg-card { border: 1px solid #bbb; border-radius: 8px; overflow: hidden; page-break-inside: avoid; }
.print-gallery .pg-card img { width: 100%; height: 150px; object-fit: cover; display: block; }
.print-gallery .pg-card .cap { padding: 8px 10px; font-size: 11.5px; }
.print-gallery .pg-card .cap b { display: block; margin-bottom: 2px; }

/* =====================================================================
   สไตล์สำหรับพิมพ์ (print) — A4, ขาวสะอาด
   ===================================================================== */
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 12px; }
  .topbar, .site-header, .site-footer, .no-print, .btn, .nav, .term-tabs { display: none !important; }
  .container { max-width: 100%; padding: 0; }
  .card, .form-card, .table { box-shadow: none; border: 1px solid #999; }
  .print-header { display: block !important; text-align: center; margin-bottom: 16px; border-bottom: 2px solid #000; padding-bottom: 10px; }
  .fieldset-title { border-color: #000; }
  a { color: #000; text-decoration: none; }
  .profile-photo { border-color: #ccc; }
}
.print-header { display: none; }

/* =====================================================================
   EduCare Hub — เช็คชื่อโฮมรูม / สถิติ
   ===================================================================== */
.form-row.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .form-row.cols-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .form-row.cols-4 { grid-template-columns: 1fr; } }

/* ตารางเช็คชื่อ */
.att-table td { vertical-align: middle; }
.att-table tr:hover td { background: #f7fafd; }

/* ปุ่มเลือกสถานะแบบ pill (radio ซ่อน) */
.status-pick { display: flex; gap: 4px; flex-wrap: wrap; }
.status-pick label { position: relative; cursor: pointer; user-select: none; }
.status-pick label input { position: absolute; opacity: 0; width: 0; height: 0; }
.status-pick label span {
  display: inline-block; padding: 6px 12px; border: 1.5px solid var(--line);
  border-radius: 16px; font-size: .84rem; color: var(--muted); transition: .12s; background: #fff;
}
.status-pick label:hover span { border-color: var(--c); color: var(--c); }
.status-pick label input:checked + span {
  background: var(--c); border-color: var(--c); color: #fff; font-weight: 600;
}
.status-pick label input:focus-visible + span { box-shadow: 0 0 0 3px rgba(30,136,229,.25); }

@media (max-width: 760px) {
  .att-table .status-pick label span { padding: 8px 12px; font-size: .9rem; }
}

/* ---------- Modal / ป็อปอัป ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(13, 25, 45, .55);
  display: none; align-items: flex-start; justify-content: center;
  z-index: 200; padding: 30px 16px; overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 640px; padding: 26px 26px 24px; position: relative;
  animation: modalpop .16s ease; margin: auto 0;
}
.modal.modal-sm { max-width: 460px; }
@keyframes modalpop { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal .modal-close {
  position: absolute; top: 10px; right: 14px; border: 0; background: none;
  font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px;
}
.modal .modal-close:hover { color: var(--ink); }
.modal .fieldset-title:first-child { margin-top: 0; }
body.modal-open { overflow: hidden; }
@media (max-width: 760px) { .modal { padding: 20px 16px; } }

/* ---------- Nav dropdown (แยกงานแนะแนว / งานดูแล) ---------- */
.menu { position: relative; }
.menu-toggle {
  font-family: var(--font); color: var(--ink); font-size: .9rem; font-weight: 500;
  padding: 8px 14px; border-radius: 8px; background: none; border: 0; cursor: pointer;
}
.menu-toggle:hover { background: var(--blue-soft); color: var(--navy); }
.submenu {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; min-width: 200px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 6px; z-index: 70;
}
.menu.open .submenu { display: block; }
.submenu a { display: block; padding: 9px 12px; border-radius: 7px; font-size: .9rem; color: var(--ink); }
.submenu a:hover { background: var(--blue-soft); color: var(--navy); text-decoration: none; }
.submenu a.active { background: var(--navy); color: #fff; }

/* ---------- Bottom nav (มือถือ) ---------- */
.bottomnav { display: none; }
body.has-bottomnav { padding-bottom: 0; }

@media (max-width: 760px) {
  /* เมนูใน hamburger: submenu แสดงแบบ inline + แบ่งกลุ่มชัด */
  .nav { gap: 0; padding: 6px 8px 10px; border-radius: 0 0 14px 14px; }
  .nav > a { border-radius: 8px; }
  .menu { width: 100%; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 4px; }
  .menu-toggle {
    width: 100%; text-align: left; font-weight: 600; color: var(--navy);
    display: flex; justify-content: space-between; align-items: center;
  }
  .menu .submenu { position: static; display: block; box-shadow: none; border: 0; padding: 2px 0 4px 10px; min-width: 0; }
  .menu .submenu a { color: var(--muted); font-weight: 500; }
  .menu .submenu a.active { color: #fff; }
  .menu:not(.open) .submenu { display: none; }

  .bottomnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
    background: #fff; border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 12px rgba(13,71,161,.08);
  }
  .bottomnav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 4px 7px; font-size: .68rem; color: var(--muted); text-decoration: none;
  }
  .bottomnav a .bn-i { font-size: 1.25rem; line-height: 1; }
  .bottomnav a.active { color: var(--navy); font-weight: 600; }
  .bottomnav a.active .bn-i { transform: translateY(-1px); }
  body.has-bottomnav { padding-bottom: 60px; }
}

/* ---------- Behavior score ---------- */
.score-badge {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 54px; padding: 4px 10px; border-radius: 20px; font-weight: 700; font-size: .95rem; color: #fff;
}
.score-ring {
  --p: 100; --c: #2e7d32;
  width: 120px; height: 120px; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), #eef2f7 0);
  display: grid; place-items: center;
}
.score-ring .inner {
  width: 92px; height: 92px; border-radius: 50%; background: #fff;
  display: grid; place-items: center; text-align: center;
}
.score-ring .inner b { font-size: 1.8rem; color: var(--ink); line-height: 1; }
.score-ring .inner span { font-size: .72rem; color: var(--muted); }

/* ---------- Sub-tabs (ใช้ซ้ำ term-tabs) ---------- */
.chip { display:inline-block; padding:2px 10px; border-radius:12px; font-size:.74rem; font-weight:600; }

/* ---------- Behavior preset chips (ครูกดเลือก) ---------- */
.preset-wrap { display:flex; flex-direction:column; gap:6px; max-height:240px; overflow-y:auto; padding-right:2px; }
.preset-chip {
  display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%;
  padding:9px 12px; border-radius:10px; border:1.5px solid var(--line); background:#fff;
  font-family:var(--font); font-size:.9rem; cursor:pointer; text-align:left; transition:.12s;
}
.preset-chip span { flex:1; }
.preset-chip b { font-weight:700; padding:1px 8px; border-radius:10px; color:#fff; font-size:.82rem; }
.preset-chip.pos b { background:#2e7d32; }
.preset-chip.neg b { background:#e53935; }
.preset-chip.pos:hover { border-color:#2e7d32; background:#f2faf3; }
.preset-chip.neg:hover { border-color:#e53935; background:#fdf3f3; }
.preset-chip.sel { border-color:var(--navy); box-shadow:0 0 0 2px rgba(13,71,161,.18); background:var(--blue-soft); }

/* ---------- Ticket thread ---------- */
.bubble { border:1px solid var(--line); border-radius:12px; padding:12px 14px; margin-bottom:10px; background:#fff; }
.bubble.staff { background: var(--blue-soft); border-color: var(--blue-mid); }
.bubble .who { font-size:.78rem; color:var(--muted); margin-bottom:4px; }

/* =====================================================================
   EduCare Hub 2026 — Forest mobile app redesign
   ===================================================================== */
:root {
  --navy: #145c45;
  --blue: #208363;
  --blue-mid: #9fcfbc;
  --blue-soft: #eef6f1;
  --slate: #345d55;
  --slate-mid: #74a792;
  --sky: #d8ece3;
  --cream: #fbfaf5;
  --ink: #1c2925;
  --muted: #71807a;
  --line: #e5ebe7;
  --white: #fff;
  --coral: #f47a67;
  --coral-soft: #fff0ec;
  --mint: #dff1e7;
  --amber: #f0b85b;
  --radius: 20px;
  --radius-sm: 13px;
  --shadow: 0 6px 22px rgba(31, 75, 60, .07);
  --shadow-lg: 0 16px 42px rgba(31, 75, 60, .13);
}

html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(circle at 100% 0, rgba(203, 232, 219, .55), transparent 24rem),
    #f5f7f5;
}
body::selection { background: var(--blue-mid); color: #103e31; }
a { color: var(--blue); }
.container { max-width: 1180px; }

.topbar { background: #104c3a; color: #d8eee5; }
.topbar .container { height: 34px; }
.site-header {
  border-bottom: 0;
  box-shadow: 0 1px 0 rgba(20, 92, 69, .08);
}
.site-header .container { height: 72px; }
.brand { text-decoration: none !important; }
.brand .logo {
  width: 44px; height: 44px; border-radius: 15px;
  background: linear-gradient(145deg, #1b7658, #0f4e3b);
  box-shadow: 0 7px 18px rgba(20, 92, 69, .2);
  font-size: .96rem; letter-spacing: -.03em;
}
.brand b { color: #173c31; font-size: 1.05rem; }
.brand span { color: #7c8d86; font-weight: 400; }
.nav a, .menu-toggle { border-radius: 12px; }
.nav a:hover, .menu-toggle:hover { background: var(--blue-soft); color: var(--navy); }
.nav a.active, .submenu a.active { background: var(--navy); color: #fff; }
.submenu { border-color: #e6eee9; border-radius: 16px; padding: 8px; }

.section { padding: 34px 0 48px; }
.section-label {
  color: var(--blue); letter-spacing: .04em; text-transform: none;
  font-size: .8rem; font-weight: 700;
}
.section h2 { color: #193a30; letter-spacing: -.02em; }
.section .lead { color: var(--muted); font-weight: 400; }

.btn {
  min-height: 43px; border-radius: 14px; padding: 10px 18px;
  box-shadow: none; transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--navy); }
.btn-primary:hover { background: #0f4937; box-shadow: 0 8px 18px rgba(20, 92, 69, .18); }
.btn-ghost { background: var(--mint); color: var(--navy); }
.btn-ghost:hover { background: #cce7da; }
.btn-slate { background: #e9efec; color: #31574c; }
.btn-slate:hover { background: #dce7e2; color: #23483e; }
.btn-danger { background: var(--coral); }

.card, .stat, .form-card {
  border: 1px solid rgba(218, 229, 223, .82);
  box-shadow: var(--shadow);
}
.card {
  border-radius: var(--radius); padding: 20px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { border-color: #c9ddd3; box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.card .tag, .tag {
  background: var(--mint); color: var(--navy); border-radius: 999px;
  font-weight: 700; letter-spacing: 0; text-transform: none;
}
.card h3 { color: #1c3f34; }
.card p { font-weight: 400; }
.stat {
  background: #fff; border-radius: 18px; padding: 18px;
  position: relative; overflow: hidden; text-align: left;
}
.stat::after {
  content: ''; position: absolute; right: -22px; top: -26px;
  width: 84px; height: 84px; border-radius: 50%; background: var(--mint);
}
.stat:nth-child(2n)::after { background: #fff0e8; }
.stat .num { color: var(--navy); font-size: 1.85rem; position: relative; z-index: 1; }
.stat .lbl { font-weight: 500; }

.form-card { border-radius: var(--radius); }
.field label { color: #3b574e; font-weight: 600; }
.field input, .field select, .field textarea {
  min-height: 46px; border-color: #dce6e1; border-radius: 13px;
  background: #fbfcfb; padding: 10px 13px;
}
.field textarea { min-height: 112px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue); box-shadow: 0 0 0 4px rgba(32, 131, 99, .1); background: #fff;
}
.fieldset-title { color: #264b40; border-color: #d8e7df; }

.table { border: 1px solid #e2eae6; border-radius: 18px; box-shadow: var(--shadow); }
.table th { background: #eaf4ef; color: #31584c; font-weight: 700; }
.table tr:hover td, .att-table tr:hover td { background: #f2f8f5; }
.term-tabs a { border-radius: 999px; border-color: #dce7e1; background: #fff; }
.term-tabs a.active { background: var(--navy); border-color: var(--navy); }
.alert { border-radius: 15px; }
.alert-info { background: #edf6f1; border-color: #c7e2d5; color: #235b48; }
.alert-ok { background: #eaf7ef; border-color: #bee1ca; color: #245f3b; }
.alert-err { background: var(--coral-soft); border-color: #f4c2b9; color: #a44134; }
.modal { border-radius: 24px; border: 1px solid #dfe9e4; }
.bubble { border-radius: 18px; }
.bubble.staff { background: #eaf5f0; border-color: #c6e2d5; }

/* Shared app-like hero used by public and role dashboards */
.app-hero {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 260px; border-radius: 0 0 34px 34px;
  background:
    radial-gradient(circle at 78% 32%, rgba(255,255,255,.13), transparent 25%),
    linear-gradient(135deg, #0f513d 0%, #167052 58%, #258366 100%);
  color: #fff; margin-top: -34px; padding: 42px 44px 34px;
  box-shadow: 0 16px 38px rgba(20, 92, 69, .17);
}
.app-hero::before {
  content: ''; position: absolute; width: 240px; height: 240px; border-radius: 50%;
  border: 48px solid rgba(255,255,255,.04); right: -80px; top: -90px; z-index: -1;
}
.app-hero__content { max-width: 58%; position: relative; z-index: 2; }
.app-hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.13); margin-bottom: 13px;
}
.app-hero h1, .app-hero h2 { color: #fff; font-size: clamp(1.65rem, 4vw, 2.45rem); margin: 0 0 8px; }
.app-hero p { color: rgba(255,255,255,.84); max-width: 560px; margin: 0 0 20px; }
.app-hero__art {
  position: absolute; right: 0; bottom: -8%; width: min(44%, 470px); height: 115%;
  object-fit: contain; object-position: center bottom; pointer-events: none;
}
.app-hero .btn-primary { background: #fff; color: var(--navy); }
.app-hero .btn-primary:hover { background: #f5fbf8; }
.app-hero .btn-ghost { background: rgba(255,255,255,.13); color: #fff; border: 1px solid rgba(255,255,255,.2); }
.app-hero .btn-ghost:hover { background: rgba(255,255,255,.2); }
.app-hero__meta { display: flex; gap: 10px; flex-wrap: wrap; }
.app-hero__meta span { font-size: .82rem; background: rgba(255,255,255,.11); padding: 5px 10px; border-radius: 999px; }

.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 20px 0 26px; }
.quick-action {
  display: flex; align-items: center; gap: 12px; min-height: 82px; padding: 14px;
  border-radius: 18px; background: #fff; color: var(--ink); border: 1px solid #e1eae5;
  box-shadow: var(--shadow); text-decoration: none !important; transition: .16s ease;
}
.quick-action:hover { transform: translateY(-2px); border-color: #c7ddd2; box-shadow: var(--shadow-lg); }
.quick-action__icon {
  flex: 0 0 48px; width: 48px; height: 48px; display: grid; place-items: center;
  border-radius: 16px; background: var(--mint); color: var(--navy); font-size: 1.35rem;
}
.quick-action:nth-child(2n) .quick-action__icon { background: #fff0e8; color: #c65c49; }
.quick-action:nth-child(3n) .quick-action__icon { background: #edf0fa; color: #5269a4; }
.quick-action b { display: block; color: #28493f; font-size: .92rem; }
.quick-action small { color: var(--muted); font-size: .72rem; }

.dashboard-block { margin-top: 28px; }
.dashboard-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 14px; }
.dashboard-heading h2, .dashboard-heading h3 { margin: 0; }
.feature-card { position: relative; overflow: hidden; }
.feature-card::after {
  content: '›'; position: absolute; right: 16px; top: 16px; width: 28px; height: 28px;
  display: grid; place-items: center; border-radius: 50%; background: #f0f6f3; color: var(--navy); font-size: 1.25rem;
}
.profile-head { gap: 18px; }
.profile-photo { border-radius: 18px; border: 4px solid #edf5f1; }
.gallery-item { border-radius: 18px; border-color: #e0e9e4; }
.gallery-item .thumb { background: linear-gradient(135deg, #e5f1eb, #b7dbc9); }

/* Public home */
.hero {
  padding: 0; color: #fff; background: transparent;
}
.hero .container { max-width: 1180px; text-align: left; }
.hero .app-hero { margin-top: 0; border-radius: 0 0 34px 34px; min-height: 430px; padding-top: 84px; }
.hero .app-hero__content { max-width: 54%; }
.hero .app-hero h1 { font-size: clamp(2.25rem, 6vw, 4.3rem); }
.hero .app-hero p { font-size: 1.05rem; opacity: 1; }

/* Login */
.auth-wrap {
  background:
    radial-gradient(circle at 12% 12%, rgba(165, 211, 190, .52), transparent 28rem),
    #f3f7f4;
  padding: 28px;
}
.auth-shell {
  width: min(980px, 100%); min-height: 610px; display: grid; grid-template-columns: 1.08fr .92fr;
  overflow: hidden; border-radius: 30px; background: #fff; box-shadow: 0 24px 70px rgba(25, 74, 58, .16);
}
.auth-visual {
  position: relative; overflow: hidden; padding: 44px; color: #fff;
  background: linear-gradient(145deg, #0f4f3c, #207a5e);
}
.auth-visual h2 { font-size: 2rem; max-width: 360px; line-height: 1.25; }
.auth-visual p { color: rgba(255,255,255,.8); max-width: 380px; }
.auth-visual img { position: absolute; width: 98%; left: 1%; bottom: -8%; }
.auth-panel { display: grid; align-items: center; padding: 52px; }
.auth-box { width: 100%; max-width: none; border: 0; box-shadow: none; padding: 0; }
.auth-box h1 { text-align: left; font-size: 1.8rem; color: #1d4136; }
.auth-box .sub { text-align: left; margin-bottom: 28px; }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 700; margin-bottom: 28px; }
.auth-brand span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; background: var(--navy); color: #fff; }

.site-footer { background: transparent; color: #7a8983; padding: 24px 0; }

@media (max-width: 980px) {
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .app-hero__content { max-width: 64%; }
  .app-hero__art { width: 42%; right: -3%; }
}

@media (max-width: 760px) {
  body { background: #f5f7f5; }
  .topbar { display: none; }
  .site-header { background: var(--navy); color: #fff; box-shadow: none; }
  .site-header .container { height: 66px; }
  .brand .logo { width: 38px; height: 38px; border-radius: 13px; background: rgba(255,255,255,.15); box-shadow: none; }
  .brand b { color: #fff; }
  .brand span { color: rgba(255,255,255,.65); }
  .burger { color: #fff; }
  .nav { background: #fff; border: 1px solid #e0e9e4; box-shadow: var(--shadow-lg); }
  .section { padding: 24px 0 34px; }
  .container { padding-left: 14px; padding-right: 14px; }
  .app-hero {
    margin: -24px -14px 0; min-height: 250px; border-radius: 0 0 28px 28px;
    padding: 27px 20px 24px;
  }
  .app-hero__content { max-width: 64%; }
  .app-hero h1, .app-hero h2 { font-size: 1.55rem; }
  .app-hero p { font-size: .84rem; line-height: 1.5; }
  .app-hero__art { width: 47%; right: -8%; height: 100%; }
  .app-hero .actions { justify-content: flex-start; }
  .app-hero .btn { padding: 9px 13px; min-height: 39px; font-size: .8rem; }
  .hero .container { padding: 0; }
  .hero .app-hero { margin: 0; border-radius: 0 0 28px 28px; min-height: 390px; padding: 50px 20px 30px; }
  .hero .app-hero__content { max-width: 68%; }
  .hero .app-hero h1 { font-size: 2.25rem; }
  .quick-actions { gap: 10px; margin-top: 15px; }
  .quick-action { min-height: 74px; padding: 10px; gap: 9px; border-radius: 16px; }
  .quick-action__icon { flex-basis: 42px; width: 42px; height: 42px; border-radius: 14px; }
  .quick-action small { display: none; }
  .grid { gap: 12px; }
  .card { border-radius: 18px; padding: 16px; }
  .stat { padding: 15px; }
  .table { border-radius: 15px; }
  .bottomnav {
    left: 10px; right: 10px; bottom: 9px; border: 1px solid #e1eae5; border-radius: 20px;
    padding: 5px 5px calc(4px + env(safe-area-inset-bottom, 0));
    box-shadow: 0 10px 30px rgba(25, 71, 56, .17);
  }
  .bottomnav a { border-radius: 15px; padding: 7px 3px 5px; }
  .bottomnav a .bn-i { filter: grayscale(1); opacity: .7; font-size: 1.15rem; }
  .bottomnav a.active { color: var(--navy); background: var(--blue-soft); }
  .bottomnav a.active .bn-i { filter: none; opacity: 1; }
  body.has-bottomnav { padding-bottom: 82px; }
  .site-footer { padding-bottom: 18px; }
  .auth-wrap { padding: 0; align-items: stretch; }
  .auth-shell { min-height: 100vh; border-radius: 0; grid-template-columns: 1fr; }
  .auth-visual { min-height: 250px; padding: 30px 24px; }
  .auth-visual h2 { font-size: 1.55rem; max-width: 62%; }
  .auth-visual p { max-width: 62%; font-size: .85rem; }
  .auth-visual img { width: 55%; left: auto; right: -5%; bottom: -12%; }
  .auth-panel { padding: 34px 24px 42px; }
}

@media (max-width: 460px) {
  .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-action { display: block; text-align: center; }
  .quick-action__icon { margin: 0 auto 7px; }
  .app-hero__content { max-width: 70%; }
  .app-hero__art { right: -15%; width: 54%; opacity: .92; }
  .hero .app-hero__content { max-width: 72%; }
}
