/* ============================================================
   e-Budget Tracking System — Stylesheet
   ============================================================ */

:root {
  --navy: #0d2b4e;
  --navy-dark: #08192f;
  --navy-light: #123a6b;
  --gold: #c9a227;
  --bg-soft: #f4f6fa;
}

* { font-family: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }

body { background-color: var(--bg-soft); }

/* ---------------- Admin Layout ---------------- */
.admin-navbar {
  background: linear-gradient(90deg, var(--navy-dark), var(--navy));
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}

.admin-shell {
  display: flex;
  min-height: calc(100vh - 56px);
}

.admin-sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--navy-dark);
  color: #fff;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: rgba(255,255,255,.75);
  padding: .65rem .9rem;
  border-radius: .5rem;
  margin-bottom: .25rem;
  text-decoration: none;
  font-size: .95rem;
  transition: background .15s ease, color .15s ease;
}
.admin-nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav-link.active { background: var(--gold); color: var(--navy-dark); font-weight: 600; }

.admin-content { flex-grow: 1; min-width: 0; }

@media (max-width: 991.98px) {
  .admin-sidebar {
    position: fixed;
    top: 56px;
    left: -260px;
    bottom: 0;
    z-index: 1030;
    transition: left .2s ease;
    overflow-y: auto;
  }
  .admin-sidebar.is-open { left: 0; box-shadow: 4px 0 20px rgba(0,0,0,.25); }
}

/* ---------------- Public Layout ---------------- */
.public-navbar {
  background: linear-gradient(90deg, var(--navy-dark), var(--navy));
  padding: 1rem 0;
}
.public-main { min-height: calc(100vh - 140px); }
.public-footer { background: var(--navy-dark); }

.tracking-search-card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(13,43,78,.08);
  padding: 2rem;
}

.tracking-hero {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  border-radius: 1rem;
  color: #fff;
  padding: 2.5rem 2rem;
  margin-bottom: -3.5rem;
  position: relative;
  z-index: 1;
}
.tracking-search-card { margin-top: 3.5rem; }

/* ---------------- Cards / KPI ---------------- */
.kpi-card {
  border: none;
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(13,43,78,.06);
  padding: 1.25rem 1.5rem;
  background: #fff;
  height: 100%;
}
.kpi-value { font-size: 1.9rem; font-weight: 700; }
.kpi-icon {
  width: 48px; height: 48px;
  border-radius: .75rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}

/* ---------------- Modern Timeline (ใช้ร่วมกัน Public + Admin) ---------------- */
.modern-timeline { position: relative; padding-left: .25rem; }

.timeline-item {
  display: flex;
  gap: 1rem;
  position: relative;
}

.timeline-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 20px;
  flex-shrink: 0;
}

.timeline-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px currentColor;
  flex-shrink: 0;
  margin-top: 2px;
}

.timeline-line {
  flex-grow: 1;
  width: 3px;
  background: #dee2e6;
  min-height: 40px;
  margin-top: 2px;
}

.timeline-body {
  padding-bottom: 1.75rem;
  flex-grow: 1;
}

.timeline-item-current .timeline-status { font-size: 1.05rem; }
.timeline-item-current .timeline-dot { box-shadow: 0 0 0 4px currentColor, 0 0 0 8px rgba(0,0,0,.05); }

.timeline-remark {
  background: var(--bg-soft);
  border-radius: .6rem;
  padding: .55rem .85rem;
  font-size: .92rem;
  color: #333;
  display: inline-block;
}

.badge-due-date {
  background-color: #fff3cd;
  color: #7a5c00;
  border: 1px solid #ffe08a;
  font-weight: 600;
}

/* ---------------- Revision Alert Box ---------------- */
.revision-alert {
  background: #fff8e6;
  border: 1px solid #ffdf7e;
  border-radius: .85rem;
  color: #6b4f00;
}
.revision-checklist {
  list-style: none;
  padding-left: 0;
  margin-bottom: .5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .25rem .5rem;
}
.revision-checklist li { font-size: .92rem; }

/* ---------------- Thai Date Field Overlay ---------------- */
.thai-date-wrapper { position: relative; }
.thai-date-wrapper .thai-date-display { background-color: #fff; cursor: pointer; }
.thai-date-wrapper .thai-date-icon {
  background-color: #fff;
  color: #0d2b4e;
  cursor: pointer;
}
.thai-date-wrapper .js-thai-date {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: calc(1.5em + .75rem + 2px); /* ให้สูงเท่ากับ .form-control / .input-group */
  opacity: 0;
  cursor: pointer;
  margin: 0;
  padding: 0;
  border: none;
}

/* ---------------- Status Update Panel ---------------- */
#revisionBox {
  background: var(--bg-soft);
  border: 1px dashed #adb5bd;
  border-radius: .75rem;
  padding: 1rem 1.25rem;
}

/* ---------------- Misc ---------------- */
.text-navy { color: var(--navy); }
.qr-preview {
  border: 1px solid #dee2e6;
  border-radius: .75rem;
  padding: .75rem;
  background: #fff;
}
