:root {
  --navy: #1e2a4a;
  --navy-2: #2c3d6b;
  --gold: #b8892b;
  --gold-soft: #f6ecd4;
  --bg: #f4f6fb;
  --radius: 14px;
}
body { font-family: 'Sarabun', system-ui, sans-serif; background: var(--bg); color: #1f2937; font-size: 16px; }
.page-title { font-weight: 700; font-size: 1.5rem; color: var(--navy); }

/* Navbar */
.app-nav { background: linear-gradient(90deg, var(--navy), var(--navy-2)); box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.app-nav .nav-link { color: rgba(255,255,255,.78); border-radius: 8px; padding: .5rem .8rem !important; }
.app-nav .nav-link:hover, .app-nav .nav-link.active { color: #fff; background: rgba(255,255,255,.1); }
.app-nav .navbar-toggler { border: 0; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--gold); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.brand-title { color: #fff; font-weight: 700; font-size: 1.02rem; }
.brand-sub { color: rgba(255,255,255,.65); font-size: .78rem; }

/* Cards */
.card-soft { border: 0; border-radius: var(--radius); box-shadow: 0 1px 3px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.04); overflow: hidden; }
.card-soft > .card-header { background: #fff; border-bottom: 1px solid #eef0f4; font-weight: 600; padding: .85rem 1.1rem; }
.form-card { max-width: 820px; }
.section-label { font-weight: 700; color: var(--navy-2); font-size: .92rem; margin: .5rem 0 .75rem; border-left: 3px solid var(--gold); padding-left: .5rem; }
.form-label.req::after { content: ' *'; color: #dc3545; }
.thai-hint { font-size: .8rem; color: #6b7280; min-height: 1.1em; margin-top: 2px; }
.scroll-box { max-height: 280px; overflow: auto; }

/* Stats */
.stat-card { display: flex; gap: .9rem; align-items: center; background: #fff; border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: 0 1px 3px rgba(16,24,40,.06); height: 100%; color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.stat-link:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16,24,40,.1); color: inherit; }
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; flex-shrink: 0; }
.stat-num { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: .85rem; color: #6b7280; }
.bg-soft-primary { background: #e8edff; color: #3b5bdb; }
.bg-soft-info { background: #e3f6fb; color: #0b7a94; }
.bg-soft-danger { background: #fdecec; color: #c92a2a; }
.bg-soft-warning { background: #fff4db; color: #b7791f; }
.bg-soft-gold { background: var(--gold-soft); color: var(--gold); }
.text-gold { color: var(--gold); }

/* Alerts list */
.alert-row { border-left: 4px solid transparent; }
.alert-row.alert-expired { border-left-color: #dc3545; background: #fff8f8; }
.alert-row.alert-soon { border-left-color: #f0ad4e; }

/* Gold button & chips */
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-gold:hover { background: #9c7322; border-color: #9c7322; color: #fff; }
.deco-chip { display: inline-block; background: var(--gold-soft); color: #7a5a17; border: 1px solid #e7d3a3; border-radius: 6px; padding: 0 .45rem; font-size: .82rem; font-weight: 600; text-align: center; }
.deco-big { font-size: 2rem; font-weight: 700; color: var(--gold); line-height: 1.2; }
.bar-gold { height: 10px; border-radius: 6px; background: linear-gradient(90deg, #d9b25f, var(--gold)); }

/* License type pills */
.type-pill { display: inline-block; border-radius: 999px; padding: .1rem .65rem; font-size: .82rem; font-weight: 600; }
.type-teacher { background: #e8edff; color: #3b5bdb; }
.type-school_admin { background: #ede7fb; color: #5f3dc4; }
.type-edu_admin { background: #f8e6f5; color: #a61e87; }
.type-supervisor { background: #e0f5ef; color: #0c7a5b; }
.type-btn { padding: .6rem .9rem; }
.row-old td { color: #9ca3af; }
.row-old a { color: #9ca3af !important; }

/* Tables */
.table thead th { background: #f8f9fc; color: #4b5563; font-weight: 600; font-size: .88rem; white-space: nowrap; }
.report-table td, .report-table th { vertical-align: middle; }
.filter-bar .card-body { padding: .9rem 1rem; }
.file-current { background: #f8f9fc; border-radius: 8px; padding: .5rem .75rem; }

/* Person */
.avatar { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, var(--navy-2), var(--navy)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; }
.timeline { list-style: none; border-left: 2px solid #e7d3a3; margin-left: 1rem; }
.timeline li { position: relative; padding: 0 0 1rem 1rem; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); }

/* Login */
.login-body { min-height: 100vh; background: radial-gradient(circle at 20% 10%, #33467a 0, var(--navy) 55%, #141c33 100%); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-card { background: #fff; border-radius: 20px; padding: 2.2rem; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-logo { width: 70px; height: 70px; border-radius: 18px; background: var(--gold); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 2.1rem; }

/* Print */
.print-only { display: none; }
@media print {
  .no-print, .navbar, footer, .btn, form.filter-bar { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; font-size: 13px; }
  .card-soft { box-shadow: none; border: 1px solid #ddd; }
  .badge { border: 1px solid #999; color: #000 !important; background: #fff !important; }
  main { max-width: 100% !important; padding: 0 !important; }
}
.app-nav .nav-link { white-space: nowrap; }
