/* โครงหน้าเว็บหลัก (index.php): แถบเมนู, ส่วนท้าย, หน้าต่างเข้าสู่ระบบ — ธีมเดียวกับแดชบอร์ดและหน้ากรอกแผน */
:root {
  --idp-brand: #0f766e;
  --idp-brand-2: #0d9488;
  --idp-brand-deep: #134e4a;
  --idp-brand-soft: #e6f4f2;
  --idp-ink: #0f1f1d;
  --idp-ink-2: #475652;
  --idp-muted: #7b8986;
  --idp-line: #e2e8e6;
  --idp-plane: #f3f6f5;
  --idp-surface: #ffffff;
  --idp-shadow: 0 1px 2px rgba(16, 40, 36, .06), 0 4px 16px rgba(16, 40, 36, .06);
  --idp-shadow-lg: 0 12px 40px rgba(16, 40, 36, .18);
}
html { scroll-behavior: smooth; }
body.idp-body { margin: 0; font-family: 'Kanit', system-ui, sans-serif; font-size: 16px; font-weight: 300; color: var(--idp-ink); background: var(--idp-plane); -webkit-font-smoothing: antialiased; }
body.idp-body h1, body.idp-body h2, body.idp-body h3, body.idp-body h4, body.idp-body h5, body.idp-body h6 { font-family: 'Kanit', system-ui, sans-serif; }
body.idp-body b, body.idp-body strong { font-weight: 500; }

/* ---- แถบเมนูบน ---- */
.idp-nav { position: sticky; top: 0; z-index: 1000; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid var(--idp-line); }
.idp-nav-in { max-width: 1352px; margin: 0 auto; padding: 0 16px; height: 64px; display: flex; align-items: center; gap: 16px; }
.idp-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--idp-ink); flex: none; }
.idp-logo .mk { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-size: 19px; background: linear-gradient(135deg, var(--idp-brand-2), var(--idp-brand-deep)); box-shadow: 0 4px 12px rgba(15, 118, 110, .35); }
.idp-logo .tx { line-height: 1.15; }
.idp-logo .tx b { display: block; font-size: 16px; font-weight: 600; }
.idp-logo .tx span { font-size: 12px; color: var(--idp-muted); }
.idp-menu { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.idp-menu > a, .idp-menu > .idp-dd > button { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 10px; border: 0; background: none; color: var(--idp-ink-2); text-decoration: none; font: inherit; font-size: 15px; font-weight: 400; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.idp-menu > a:hover, .idp-menu > .idp-dd > button:hover, .idp-dd.open > button { background: var(--idp-brand-soft); color: var(--idp-brand); }
.idp-menu > a.on { color: var(--idp-brand); background: var(--idp-brand-soft); font-weight: 500; }
.idp-menu .bi-chevron-down { font-size: 11px; transition: transform .2s; }
.idp-dd.open .bi-chevron-down { transform: rotate(180deg); }
.idp-menu > a.cta { background: var(--idp-brand); color: #fff; font-weight: 500; margin-left: 6px; box-shadow: 0 2px 8px rgba(15, 118, 110, .3); }
.idp-menu > a.cta:hover { background: var(--idp-brand-deep); color: #fff; }

.idp-dd { position: relative; }
.idp-dd-panel { display: none; position: absolute; top: calc(100% + 8px); left: 0; min-width: 300px; background: var(--idp-surface); border: 1px solid var(--idp-line); border-radius: 14px; box-shadow: var(--idp-shadow-lg); padding: 8px; z-index: 1001; }
.idp-dd.right .idp-dd-panel { left: auto; right: 0; min-width: 220px; }
.idp-dd.open .idp-dd-panel { display: block; animation: idpPop .14s ease-out; }
@keyframes idpPop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.idp-dd-search { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; padding: 8px 12px 8px 34px; border: 1px solid var(--idp-line); border-radius: 10px; margin-bottom: 6px; background: var(--idp-plane) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%237b8986' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398l3.85 3.85a1 1 0 0 0 1.415-1.414zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/%3E%3C/svg%3E") no-repeat 11px 50%; outline: none; }
.idp-dd-search:focus { border-color: var(--idp-brand-2); background-color: #fff; box-shadow: 0 0 0 3px rgba(13, 148, 136, .15); }
.idp-dd-list { max-height: min(60vh, 440px); overflow-y: auto; }
.idp-dd-panel a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 8px; color: var(--idp-ink); text-decoration: none; font-size: 14px; }
.idp-dd-panel a:hover, .idp-dd-panel a.on { background: var(--idp-brand-soft); color: var(--idp-brand); }
.idp-dd-panel a .n { flex: none; font-size: 12px; color: var(--idp-muted); background: var(--idp-plane); border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.idp-dd-panel a[hidden], .idp-dd-empty[hidden] { display: none; }
.idp-dd-panel .sep { height: 1px; background: var(--idp-line); margin: 6px 4px; }
.idp-dd-panel a.all { font-weight: 500; color: var(--idp-brand); }
.idp-dd-empty { padding: 10px; font-size: 13px; color: var(--idp-muted); }
.idp-avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--idp-brand-soft); color: var(--idp-brand); font-size: 13px; font-weight: 600; }
.idp-burger { display: none; margin-left: auto; width: 42px; height: 42px; border: 1px solid var(--idp-line); border-radius: 10px; background: var(--idp-surface); color: var(--idp-ink); font-size: 22px; cursor: pointer; }

@media (max-width: 1080px) {
  .idp-logo .tx span { display: none; }
  .idp-burger { display: grid; place-items: center; }
  .idp-menu { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 16px 16px; background: var(--idp-surface); border-bottom: 1px solid var(--idp-line); box-shadow: var(--idp-shadow-lg); max-height: calc(100vh - 64px); overflow-y: auto; }
  .idp-nav.open .idp-menu { display: flex; }
  .idp-menu > a, .idp-menu > .idp-dd > button { width: 100%; justify-content: flex-start; }
  .idp-menu > a.cta { margin: 6px 0 0; justify-content: center; }
  .idp-dd-panel { position: static; box-shadow: none; border: 0; padding: 4px 0 4px 12px; min-width: 0; }
  .idp-dd.right .idp-dd-panel { min-width: 0; }
  .idp-dd-list { max-height: 50vh; }
}

/* ---- เนื้อหา ---- */
.idp-main { min-height: calc(100vh - 64px - 160px); }

/* ---- ส่วนท้าย ---- */
.idp-foot { background: var(--idp-brand-deep); color: rgba(255, 255, 255, .78); margin-top: 0; }
.idp-foot-in { max-width: 1352px; margin: 0 auto; padding: 28px 16px; display: flex; flex-wrap: wrap; gap: 16px 40px; align-items: center; justify-content: space-between; font-size: 14px; }
.idp-foot .org { display: flex; align-items: center; gap: 12px; }
.idp-foot .org .mk { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .12); color: #fff; font-size: 19px; }
.idp-foot .org b { display: block; color: #fff; font-size: 16px; font-weight: 500; }
.idp-foot .ct { line-height: 1.7; }
.idp-foot .ct i { margin-right: 6px; opacity: .7; }
.idp-foot .cp { width: 100%; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 14px; font-size: 12px; color: rgba(255, 255, 255, .55); }

/* ---- หน้าต่าง (modal) ---- */
.idp-modal { display: none; position: fixed; inset: 0; z-index: 2000; background: rgba(10, 30, 28, .5); backdrop-filter: blur(3px); padding: 16px; overflow-y: auto; }
.idp-modal.show { display: grid; place-items: center; animation: idpFade .15s ease-out; }
@keyframes idpFade { from { opacity: 0; } to { opacity: 1; } }
.idp-modal-box { position: relative; width: 100%; max-width: 420px; background: var(--idp-surface); border-radius: 20px; box-shadow: var(--idp-shadow-lg); overflow: hidden; animation: idpRise .2s ease-out; }
@keyframes idpRise { from { transform: translateY(12px) scale(.98); } to { transform: none; } }
.idp-modal-hero { padding: 26px 26px 18px; background: linear-gradient(135deg, var(--idp-brand-2), var(--idp-brand-deep)); color: #fff; }
.idp-modal-hero .mk { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, .16); font-size: 22px; margin-bottom: 12px; }
.idp-modal-hero h2 { margin: 0; font-size: 22px; font-weight: 500; }
.idp-modal-hero p { margin: 4px 0 0; font-size: 14px; color: rgba(255, 255, 255, .8); }
.idp-modal-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 16px; cursor: pointer; display: grid; place-items: center; }
.idp-modal-x:hover { background: rgba(255, 255, 255, .26); }
.idp-modal-body { padding: 22px 26px 26px; }
.idp-notice { display: none; gap: 10px; padding: 10px 12px; margin-bottom: 16px; border-radius: 12px; background: #fff7e0; color: #7a5200; font-size: 14px; }
.idp-notice.show { display: flex; }
.idp-field { margin-bottom: 14px; }
.idp-field label { display: block; font-size: 14px; font-weight: 500; color: var(--idp-ink-2); margin-bottom: 6px; }
.idp-input { position: relative; }
.idp-input i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--idp-muted); }
.idp-input input { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; padding: 11px 14px 11px 40px; border: 1.5px solid var(--idp-line); border-radius: 12px; background: var(--idp-plane); color: var(--idp-ink); outline: none; transition: border-color .15s, box-shadow .15s, background .15s; }
.idp-input input:focus { border-color: var(--idp-brand-2); background: #fff; box-shadow: 0 0 0 4px rgba(13, 148, 136, .15); }
.idp-btn-primary { width: 100%; font: inherit; font-size: 16px; font-weight: 500; padding: 12px; margin-top: 6px; border: 0; border-radius: 12px; background: var(--idp-brand); color: #fff; cursor: pointer; box-shadow: 0 4px 14px rgba(15, 118, 110, .3); transition: background .15s, transform .1s; }
.idp-btn-primary:hover { background: var(--idp-brand-deep); }
.idp-btn-primary:active { transform: translateY(1px); }
.idp-modal-foot { margin-top: 14px; font-size: 13px; color: var(--idp-muted); text-align: center; }
.idp-btn-ghost { font: inherit; font-size: 14px; padding: 9px 18px; border: 1px solid var(--idp-line); border-radius: 10px; background: var(--idp-surface); color: var(--idp-ink); cursor: pointer; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
