:root {
  --sidebar-width: clamp(240px, calc((100vw - 36px) / 6), 320px);
  --dashboard-rail-width: clamp(260px, calc((100vw - var(--sidebar-width) - 96px) / 6), 320px);
  --bg: #f5f1e8;
  --bg-soft: #fbf8f1;
  --panel: rgba(255, 252, 246, 0.84);
  --panel-strong: #fffdf8;
  --line: rgba(21, 36, 51, 0.12);
  --line-strong: rgba(21, 36, 51, 0.18);
  --text: #16212c;
  --muted: #607081;
  --accent: #e36d45;
  --accent-strong: #bf4f2b;
  --teal: #1f8a78;
  --teal-deep: #123f47;
  --success: #1f7a4b;
  --danger: #a63a32;
  --shadow: 0 22px 55px rgba(20, 31, 43, 0.09);
  --shadow-soft: 0 10px 26px rgba(20, 31, 43, 0.06);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Sarabun', 'Segoe UI', sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at top left, rgba(227, 109, 69, 0.24), transparent 28%),
    radial-gradient(circle at 85% 18%, rgba(31, 138, 120, 0.14), transparent 22%),
    linear-gradient(rgba(255, 255, 255, 0.46) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.46) 1px, transparent 1px),
    linear-gradient(180deg, #f8f3ea 0%, #f2ece1 100%);
  background-size: auto, auto, 34px 34px, 34px 34px, auto;
}

body.nav-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

p {
  margin: 0;
}

h1,
h2,
h3,
h4,
.brand-title,
.summary-chip strong,
.info-card strong,
.profile-card strong,
.stat-highlight-card strong {
  font-family: 'Prompt', 'Sarabun', sans-serif;
}

.page-shell {
  position: relative;
  overflow-x: clip;
  overflow-y: visible;
  min-height: 100vh;
  padding: 18px;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.page-stage {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.mobile-topbar {
  display: none;
}

.drawer-backdrop {
  display: none;
}

.page-content {
  max-width: none;
  margin: 0;
  min-width: 0;
}

.page-frame {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.bg-grid {
  position: fixed;
  z-index: -1;
  border-radius: 32px;
  filter: blur(10px);
  opacity: 0.95;
}

.bg-grid-a {
  top: -70px;
  right: -36px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle at center, rgba(227, 109, 69, 0.22), rgba(227, 109, 69, 0.03) 70%);
}

.bg-grid-b {
  bottom: 8%;
  left: -40px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle at center, rgba(31, 138, 120, 0.18), rgba(31, 138, 120, 0.03) 70%);
}

.site-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  max-width: none;
  margin: 0;
  position: sticky;
  top: 18px;
  align-self: start;
  height: calc(100vh - 36px);
  overflow: hidden;
  scrollbar-width: thin;
}

.site-header-scroll {
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  overflow-x: hidden;
  padding-right: 2px;
}

.header-brand-panel,
.header-nav-panel,
.hero-panel,
.info-card,
.auth-card,
.auth-support-card,
.profile-header-card,
.profile-card,
.error-card,
.projects-hero,
.project-card,
.admin-panel,
.dashboard-filter-card,
.dashboard-list-panel,
.stat-highlight-card,
.mini-project-card,
.admin-note-card,
.error-support-card,
.support-item,
.table-shell,
.chairman-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86) 0%, rgba(255, 250, 244, 0.74) 100%);
  box-shadow: var(--shadow);
}

.header-brand-panel::before,
.header-nav-panel::before,
.hero-panel::before,
.info-card::before,
.auth-card::before,
.auth-support-card::before,
.profile-header-card::before,
.profile-card::before,
.error-card::before,
.projects-hero::before,
.project-card::before,
.admin-panel::before,
.dashboard-filter-card::before,
.dashboard-list-panel::before,
.stat-highlight-card::before,
.mini-project-card::before,
.admin-note-card::before,
.error-support-card::before,
.support-item::before,
.chairman-card::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, rgba(227, 109, 69, 0.78) 0%, rgba(31, 138, 120, 0.62) 100%);
}

.header-brand-panel,
.header-nav-panel {
  padding: 24px 26px;
}

.header-brand-panel {
  display: grid;
  gap: 18px;
  align-content: space-between;
  min-height: 240px;
}

.brand {
  display: grid;
  gap: 10px;
}

.brand-kicker,
.eyebrow,
.card-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
  background: rgba(227, 109, 69, 0.12);
}

.brand-title {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.05;
  font-weight: 700;
}

.brand-meta,
.nav-meta p,
.section-text,
.hero-text,
.info-card p,
.profile-card p,
.support-item p,
.error-card p,
.admin-note-card p,
.note-card p,
.form-helper-text,
.project-meta-row p {
  color: var(--muted);
  line-height: 1.75;
}

.header-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.header-chip,
.role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(21, 36, 51, 0.1);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  font-weight: 700;
}

.header-chip-strong,
.role-badge {
  background: rgba(31, 138, 120, 0.12);
  color: var(--teal);
}

.header-nav-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: scroll;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(96, 112, 129, 0.7) rgba(255, 255, 255, 0.32);
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.header-nav-panel::-webkit-scrollbar {
  width: 9px;
}

.header-nav-panel::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
}

.header-nav-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(96, 112, 129, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.34);
}

.header-nav-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(22, 33, 44, 0.8);
}

.nav-meta {
  display: grid;
  gap: 10px;
  flex: 0 0 auto;
}

.site-nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  flex-wrap: nowrap;
  flex: 0 0 auto;
}

.admin-nav-group {
  position: relative;
  display: grid;
  gap: 10px;
}

.admin-nav-trigger {
  justify-content: space-between;
}

.admin-nav-caret {
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.admin-nav-submenu {
  display: none;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
}

.admin-nav-group:hover .admin-nav-submenu,
.admin-nav-group:focus-within .admin-nav-submenu,
.admin-nav-group.is-active .admin-nav-submenu {
  display: grid;
}

.admin-nav-group:hover .admin-nav-caret,
.admin-nav-group:focus-within .admin-nav-caret,
.admin-nav-group.is-active .admin-nav-caret {
  transform: rotate(225deg) translateY(-1px);
}

.admin-subnav-link {
  min-height: 42px;
  padding-left: 16px;
  border-radius: 14px;
  font-size: 0.95rem;
}

.site-nav form,
.table-actions form {
  margin: 0;
  width: 100%;
}

.nav-link,
.nav-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.nav-link,
.nav-button {
  width: 100%;
}

.nav-link.is-active,
.nav-link:hover,
.nav-button:hover,
.secondary-button:hover,
.danger-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.nav-link.is-active,
.nav-link:hover,
.nav-button:hover,
.secondary-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.92);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 18px;
  font-weight: 700;
  color: #fffdf8;
  background: linear-gradient(135deg, var(--text) 0%, #22384a 58%, var(--accent) 100%);
  box-shadow: 0 14px 30px rgba(22, 33, 44, 0.18);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.mobile-brand {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.mobile-brand-kicker {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.mobile-brand-title {
  font-family: 'Prompt', 'Sarabun', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.menu-toggle-label {
  font-weight: 700;
}

.menu-toggle-icon {
  display: inline-grid;
  gap: 4px;
}

.menu-icon-bar {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

body.nav-open .menu-icon-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

body.nav-open .menu-icon-bar:nth-child(2) {
  opacity: 0;
}

body.nav-open .menu-icon-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.danger-button {
  color: var(--danger);
  background: rgba(245, 223, 220, 0.78);
  border-color: rgba(166, 58, 50, 0.16);
}

.inverse-button {
  color: #fff8f2;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
}

.full-width {
  width: 100%;
}

.hero-bento,
.login-bento,
.dashboard-top-grid,
.profile-overview-grid,
.profile-grid,
.project-list,
.dashboard-stats-grid,
.dashboard-mini-list,
.admin-bento-layout,
.chairman-card-grid,
.error-bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.hero-panel-main {
  grid-column: span 7;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 360px;
  padding: 34px;
}

.home-hero-showcase {
  justify-content: flex-start;
  gap: 24px;
  background:
    radial-gradient(circle at top right, rgba(31, 138, 120, 0.14), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 248, 241, 0.82) 100%);
}

.hero-year-card {
  grid-column: span 5;
  min-height: 190px;
  padding: 28px;
}

.hero-guide-card {
  grid-column: span 5;
  display: grid;
  gap: 18px;
  align-content: start;
  min-height: 360px;
  padding: 28px;
  background:
    radial-gradient(circle at top right, rgba(227, 109, 69, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255, 252, 248, 0.96) 0%, rgba(247, 252, 249, 0.84) 100%);
}

.hero-guide-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.hero-guide-copy {
  display: grid;
  gap: 10px;
}

.hero-guide-copy strong {
  font-family: 'Prompt', 'Sarabun', sans-serif;
  font-size: clamp(1.4rem, 2.6vw, 1.95rem);
  line-height: 1.24;
  color: var(--ink-900);
}

.hero-guide-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.hero-guide-badge {
  min-width: 120px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(21, 36, 51, 0.08);
  background: linear-gradient(180deg, rgba(255, 243, 233, 0.96) 0%, rgba(255, 255, 255, 0.9) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.hero-guide-badge span {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.hero-guide-badge strong {
  display: block;
  margin-top: 8px;
  color: var(--ink-900);
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  line-height: 1;
}

.hero-guide-sections {
  display: grid;
  gap: 14px;
}

.home-guide-example-title {
  margin-top: 14px;
}

.home-guide-example {
  margin-top: 12px;
  margin-bottom: 0;
}

.home-project-code-list {
  padding-left: 0;
  list-style: none;
}

.home-project-code-list li {
  position: relative;
  padding-left: 1.1rem;
}

.home-project-code-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent-strong);
}

.hero-feature-card {
  grid-column: span 4;
  padding: 24px;
}

.hero-copy h1,
.auth-card h1,
.profile-header-card h1,
.error-card h1 {
  margin: 14px 0 16px;
  line-height: 1.06;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
}

.hero-actions {
  margin-top: 24px;
}

.hero-carousel {
  width: min(100%, 760px);
  margin-inline: auto;
  display: grid;
  gap: 14px;
}

.hero-carousel-stage {
  position: relative;
  min-height: clamp(280px, 42vw, 430px);
  border-radius: 28px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, 0.64);
  background: #d7e6e3;
  box-shadow: 0 24px 44px rgba(20, 31, 43, 0.18);
}

.hero-carousel-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(10, 18, 25, 0.04) 0%, rgba(10, 18, 25, 0.08) 32%, rgba(10, 18, 25, 0.5) 100%),
    linear-gradient(115deg, rgba(227, 109, 69, 0.14), transparent 44%);
}

.hero-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  animation: heroSlideFade 40s infinite;
  animation-delay: calc(var(--slide-index) * 5s);
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.03) contrast(1.02);
  transform: scale(1.08);
  animation: heroSlideZoom 40s infinite;
  animation-delay: calc(var(--slide-index) * 5s);
}

.hero-carousel-overlay {
  position: absolute;
  inset: auto 20px 20px 20px;
  z-index: 2;
  display: grid;
  gap: 10px;
  max-width: min(100%, 440px);
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  color: #fffaf4;
  background: linear-gradient(180deg, rgba(19, 35, 48, 0.76) 0%, rgba(19, 35, 48, 0.58) 100%);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 28px rgba(12, 21, 30, 0.18);
}

.hero-carousel-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-carousel-overlay strong {
  font-family: 'Prompt', 'Sarabun', sans-serif;
  font-size: clamp(1.3rem, 2vw, 1.72rem);
  line-height: 1.2;
}

.hero-carousel-overlay p,
.hero-actions-note {
  line-height: 1.7;
}

.hero-carousel-overlay p {
  color: rgba(255, 248, 241, 0.84);
}

.hero-carousel-indicators {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.hero-carousel-indicator {
  position: relative;
  flex: 1 1 56px;
  max-width: 80px;
  min-width: 42px;
  height: 6px;
  border-radius: 999px;
  background: rgba(22, 33, 44, 0.12);
  overflow: hidden;
}

.hero-carousel-indicator::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--text) 0%, var(--accent) 100%);
  transform: scaleX(0);
  transform-origin: left;
  animation: heroIndicatorFill 40s infinite;
  animation-delay: calc(var(--slide-index) * 5s);
}

.hero-actions-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin-top: 0;
}

.hero-actions-note {
  max-width: 34rem;
  color: var(--muted);
}

.hero-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
}

.info-card,
.profile-card,
.support-item,
.admin-note-card,
.error-support-card {
  padding: 24px;
}

.info-card strong,
.profile-card strong,
.support-item strong,
.admin-note-card strong,
.error-support-card strong {
  display: block;
  margin: 12px 0 8px;
  font-size: 1.32rem;
  line-height: 1.2;
}

.accent-card {
  background: linear-gradient(145deg, rgba(227, 109, 69, 0.96) 0%, rgba(191, 79, 43, 0.96) 100%);
  border-color: rgba(191, 79, 43, 0.2);
  color: #fff9f4;
}

.accent-card .card-label,
.accent-card p,
.accent-card .section-text {
  color: rgba(255, 249, 244, 0.84);
  background: rgba(255, 255, 255, 0.12);
}

.distribution-shell {
  display: grid;
  gap: 20px;
}

.distribution-hero {
  padding: 30px;
  background:
    radial-gradient(circle at top right, rgba(227, 109, 69, 0.16), transparent 26%),
    radial-gradient(circle at left bottom, rgba(31, 138, 120, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 247, 240, 0.82) 100%);
}

.distribution-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: stretch;
}

.distribution-summary-panel {
  display: grid;
  gap: 14px;
}

.distribution-summary-card {
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(21, 36, 51, 0.1);
  background: linear-gradient(180deg, rgba(20, 33, 44, 0.96) 0%, rgba(34, 56, 74, 0.95) 100%);
  color: #fff9f3;
  box-shadow: 0 20px 40px rgba(20, 31, 43, 0.16);
}

.distribution-summary-card .card-label {
  color: rgba(255, 248, 241, 0.9);
  background: rgba(255, 255, 255, 0.12);
}

.distribution-summary-card strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  line-height: 1;
}

.distribution-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.distribution-meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 249, 244, 0.92);
  font-weight: 600;
}

.distribution-highlight-list {
  display: grid;
  gap: 14px;
}

.distribution-highlight-card {
  padding: 20px 22px;
  border-radius: 22px;
  border: 1px solid rgba(21, 36, 51, 0.08);
  background: rgba(255, 255, 255, 0.84);
}

.distribution-highlight-card strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 1.4rem;
}

.distribution-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.distribution-part-card {
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(21, 36, 51, 0.1);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
}

.distribution-part-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.distribution-part-head strong {
  display: block;
  font-size: 1.24rem;
  line-height: 1.35;
}

.distribution-percent-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-family: 'Prompt', 'Sarabun', sans-serif;
  font-weight: 700;
}

.distribution-part-amount {
  margin-top: 18px;
  font-family: 'Prompt', 'Sarabun', sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.08;
}

.distribution-part-meta {
  margin-top: 8px;
  color: var(--muted);
}

.distribution-bar-track {
  position: relative;
  height: 14px;
  margin-top: 18px;
  border-radius: 999px;
  background: rgba(21, 36, 51, 0.08);
  overflow: hidden;
}

.distribution-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill-width, 0%);
  border-radius: inherit;
}

.distribution-detail-table {
  width: 100%;
  border-collapse: collapse;
}

.distribution-detail-table th,
.distribution-detail-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(21, 36, 51, 0.08);
  text-align: left;
}

.distribution-detail-table th {
  color: var(--muted);
  font-weight: 700;
}

.distribution-detail-table td.table-number-cell,
.distribution-detail-table th.table-number-cell {
  text-align: right;
}

.distribution-tone-a .distribution-percent-pill {
  background: rgba(227, 109, 69, 0.14);
  color: var(--accent-strong);
}

.distribution-tone-a .distribution-bar-fill {
  background: linear-gradient(90deg, rgba(227, 109, 69, 0.92) 0%, rgba(191, 79, 43, 0.92) 100%);
}

.distribution-tone-b .distribution-percent-pill {
  background: rgba(31, 138, 120, 0.14);
  color: var(--teal);
}

.distribution-tone-b .distribution-bar-fill {
  background: linear-gradient(90deg, rgba(31, 138, 120, 0.9) 0%, rgba(18, 63, 71, 0.92) 100%);
}

.distribution-tone-c .distribution-percent-pill {
  background: rgba(22, 33, 44, 0.1);
  color: var(--text);
}

.distribution-tone-c .distribution-bar-fill {
  background: linear-gradient(90deg, rgba(34, 56, 74, 0.92) 0%, rgba(22, 33, 44, 0.98) 100%);
}

.distribution-tone-d .distribution-percent-pill {
  background: rgba(190, 156, 76, 0.18);
  color: #8a6412;
}

.distribution-tone-d .distribution-bar-fill {
  background: linear-gradient(90deg, rgba(214, 171, 73, 0.94) 0%, rgba(173, 122, 21, 0.94) 100%);
}

@media (max-width: 980px) {
  .distribution-hero-grid,
  .distribution-grid {
    grid-template-columns: 1fr;
  }
}

@keyframes heroSlideFade {
  0%,
  12% {
    opacity: 1;
  }

  16%,
  100% {
    opacity: 0;
  }
}

@keyframes heroSlideZoom {
  0% {
    transform: scale(1.08);
  }

  12% {
    transform: scale(1);
  }

  16%,
  100% {
    transform: scale(1.04);
  }
}

@keyframes heroIndicatorFill {
  0% {
    transform: scaleX(0);
  }

  12% {
    transform: scaleX(1);
  }

  16%,
  100% {
    transform: scaleX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide,
  .hero-slide img,
  .hero-carousel-indicator::after {
    animation: none;
  }

  .hero-slide {
    opacity: 0;
  }

  .hero-slide:first-child {
    opacity: 1;
  }

  .hero-slide:first-child img {
    transform: scale(1);
  }

  .hero-carousel-indicator::after {
    transform: scaleX(0);
  }

  .hero-carousel-indicator:first-child::after {
    transform: scaleX(1);
  }
}

.auth-section,
.projects-section,
.dashboard-section,
.profile-section,
.admin-section {
  display: grid;
  gap: 18px;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--dashboard-rail-width);
  gap: 18px;
  align-items: start;
}

.dashboard-layout-main-only {
  grid-template-columns: minmax(0, 1fr);
}

.dashboard-main-column,
.dashboard-side-rail,
.dashboard-rail-stats {
  display: grid;
  gap: 18px;
}

.dashboard-side-rail {
  position: sticky;
  top: 18px;
  align-self: start;
  width: 100%;
  justify-items: stretch;
}

.dashboard-hero-wide {
  min-height: 240px;
}

.dashboard-rail-card {
  min-width: 0;
  width: 100%;
  justify-self: stretch;
}

.login-bento {
  align-items: stretch;
}

.auth-support-card {
  grid-column: span 5;
  display: grid;
  gap: 18px;
  padding: 28px;
}

.auth-card-main {
  grid-column: span 7;
  padding: 34px;
}

.login-bento > .auth-card-main:only-child {
  grid-column: 3 / span 8;
  width: min(100%, 760px);
  justify-self: center;
}

@media (min-width: 981px) {
  .login-bento {
    min-height: calc(100dvh - 72px);
    align-content: center;
    padding-block: clamp(28px, 7vh, 64px);
  }
}

.auth-support-card h2 {
  margin: 12px 0 14px;
  line-height: 1.15;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.support-list {
  display: grid;
  gap: 14px;
}

.support-item {
  border-radius: var(--radius-lg);
  box-shadow: none;
}

.support-item-accent {
  height: 100%;
}

.auth-form {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.form-field {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.form-field input,
.form-field select {
  min-height: 56px;
  padding: 0 16px;
}

.form-field textarea {
  min-height: 132px;
  padding: 14px 16px;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: rgba(31, 138, 120, 0.45);
  box-shadow: 0 0 0 4px rgba(31, 138, 120, 0.12);
  background: #ffffff;
}

.alert-error,
.alert-success {
  margin-top: 18px;
  padding: 15px 16px;
  border-radius: 18px;
  border: 1px solid transparent;
  line-height: 1.65;
}

.alert-error {
  color: var(--danger);
  background: rgba(230, 108, 89, 0.12);
  border-color: rgba(230, 108, 89, 0.18);
}

.alert-success {
  color: var(--success);
  background: rgba(52, 166, 110, 0.11);
  border-color: rgba(52, 166, 110, 0.2);
}

.profile-overview-grid {
  align-items: stretch;
}

.profile-header-card {
  grid-column: span 8;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 32px;
}

.profile-callout-card {
  grid-column: span 4;
  display: grid;
  gap: 12px;
  align-content: flex-start;
}

.profile-grid {
  align-items: stretch;
}

.profile-summary-shell {
  display: grid;
  justify-items: center;
}

.profile-summary-card {
  width: min(100%, 860px);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 250, 244, 0.78) 100%);
  box-shadow: var(--shadow);
}

.profile-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.profile-summary-head h1 {
  margin: 10px 0 10px;
  line-height: 1.08;
  font-size: clamp(2rem, 4vw, 3rem);
}

.profile-summary-list {
  display: grid;
  gap: 12px;
}

.profile-summary-row {
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
  gap: 10px 18px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid rgba(21, 36, 51, 0.08);
}

.profile-summary-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.profile-summary-label {
  color: var(--accent-strong);
  font-weight: 700;
}

.profile-summary-value {
  color: var(--text);
  line-height: 1.7;
  font-weight: 600;
}

.profile-summary-row-note .profile-summary-value {
  font-weight: 500;
  color: var(--muted);
}

.profile-edit-block {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.profile-summary-actions {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-start;
}

.profile-edit-head {
  margin-bottom: 18px;
}

.profile-edit-head h2 {
  margin: 10px 0 10px;
  line-height: 1.12;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.profile-edit-form {
  margin-top: 0;
}

.profile-card {
  grid-column: span 4;
}

.note-card {
  grid-column: span 8;
}

.profile-actions {
  display: flex;
  justify-content: flex-start;
}

.projects-hero,
.dashboard-hero-tile,
.admin-panel {
  padding: 30px;
}

.projects-hero,
.dashboard-list-head,
.mini-project-head,
.project-card-top,
.chairman-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-hero-tile {
  grid-column: span 8;
}

.project-directory-hero {
  grid-column: span 12;
  display: grid;
  gap: 22px;
}

.project-directory-print-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.project-directory-print-button {
  min-height: 44px;
}

.project-directory-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.project-directory-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
  gap: 20px;
  align-items: start;
}

.dashboard-filter-card {
  grid-column: span 4;
  display: grid;
  gap: 16px;
  padding: 24px;
  align-content: end;
}

.dashboard-filter-card .form-field,
.dashboard-filter-card .admin-actions-row {
  grid-column: 1 / -1;
}

.dashboard-side-rail > .dashboard-filter-card,
.dashboard-side-rail > .dashboard-rail-stats {
  width: 100%;
}

.summary-chip {
  min-width: 180px;
  padding: 20px 22px;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(31, 138, 120, 0.14) 0%, rgba(227, 109, 69, 0.2) 100%);
  border: 1px solid rgba(21, 36, 51, 0.1);
}

.summary-chip span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.summary-chip strong {
  font-size: clamp(2rem, 4vw, 2.7rem);
  line-height: 1;
}

.summary-chip-highlight {
  background: linear-gradient(145deg, rgba(22, 33, 44, 0.92) 0%, rgba(31, 138, 120, 0.92) 100%);
  color: #fffaf5;
}

.summary-chip-highlight span {
  color: rgba(255, 250, 245, 0.8);
}

.admin-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.align-end-row {
  align-items: flex-end;
}

.project-list,
.dashboard-mini-list,
.dashboard-stats-grid {
  align-items: stretch;
}

.project-card {
  grid-column: span 6;
  padding: 28px;
}

.project-card-featured {
  grid-column: span 12;
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.92) 0%, rgba(244, 247, 246, 0.86) 100%);
}

.project-card h2,
.project-name,
.dashboard-list-head h2,
.mini-project-card h3 {
  margin: 8px 0 0;
}

.dashboard-list-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-print-button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  white-space: nowrap;
}

.project-name {
  font-size: 1.36rem;
}

.project-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.stat-box {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(21, 36, 51, 0.08);
}

.stat-box strong {
  display: block;
  margin-top: 8px;
  font-size: 1.06rem;
}

.project-meta-row,
.project-actions-row {
  margin-top: 20px;
}

.dashboard-stats-grid .stat-highlight-card {
  grid-column: span 3;
  min-height: 180px;
  padding: 24px;
}

.dashboard-rail-stats {
  grid-template-columns: 1fr;
}

.dashboard-rail-stats .stat-highlight-card {
  grid-column: auto;
  min-height: 0;
}

@media (min-width: 1081px) {
  .dashboard-side-rail {
    grid-template-rows: auto minmax(0, 1fr);
    max-height: calc(100dvh - 18px);
    gap: 10px;
  }

  .dashboard-rail-stats {
    width: 100%;
    gap: 10px;
    min-height: 0;
    grid-auto-rows: 1fr;
  }

  .dashboard-rail-stats .stat-highlight-card {
    display: grid;
    align-content: start;
    gap: 8px;
    height: 100%;
    padding: 18px 18px 16px;
  }

  .dashboard-rail-stats .stat-highlight-card strong {
    margin: 2px 0;
    font-size: clamp(1.35rem, 1.65vw, 1.85rem);
    line-height: 1.05;
  }

  .dashboard-rail-stats .card-label {
    min-height: 24px;
    padding: 0 10px;
    font-size: 0.72rem;
  }

  .dashboard-rail-stats .section-text {
    font-size: 0.92rem;
    line-height: 1.5;
  }
}

.stat-highlight-card strong {
  display: block;
  margin: 12px 0;
  font-size: clamp(2rem, 4vw, 2.7rem);
  line-height: 1;
}

.accent-surface-card {
  background: linear-gradient(160deg, rgba(31, 138, 120, 0.96) 0%, rgba(18, 63, 71, 0.96) 100%);
  color: #f7fffc;
}

.accent-surface-card .card-label,
.accent-surface-card .section-text {
  color: rgba(247, 255, 252, 0.82);
  background: rgba(255, 255, 255, 0.14);
}

.dashboard-list-panel {
  padding: 28px;
}

.dashboard-mini-list {
  margin-top: 20px;
}

.mini-project-card {
  grid-column: span 6;
  padding: 24px;
}

.mini-project-card-featured {
  grid-column: span 12;
}

.admin-bento-layout {
  align-items: start;
}

.admin-bento-layout-main-only > .admin-panel {
  grid-column: 1 / -1;
}

.admin-panel {
  grid-column: span 8;
  width: 100%;
}

.admin-side-column {
  grid-column: span 4;
  display: grid;
  gap: 18px;
}

.admin-note-card {
  min-height: 180px;
}

.project-header-table-shell {
  margin-top: 24px;
}

.project-header-table {
  min-width: 1040px;
}

.project-header-table td {
  vertical-align: top;
}

.project-header-table input,
.project-header-table select,
.project-header-table textarea {
  width: 100%;
  margin: 0;
}

.project-header-table tbody tr {
  background: rgba(255, 252, 248, 0.72);
}

.project-header-table tbody tr:nth-child(even) {
  background: rgba(248, 251, 250, 0.9);
}

.project-header-table textarea {
  min-height: 92px;
  resize: vertical;
}

.project-header-row-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(31, 138, 120, 0.16) 0%, rgba(227, 109, 69, 0.2) 100%);
  border: 1px solid rgba(21, 36, 51, 0.08);
  box-shadow: 0 12px 24px rgba(21, 36, 51, 0.08);
  font-weight: 700;
  color: var(--accent-strong);
}

.project-header-position-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 248, 241, 0.98) 0%, rgba(255, 255, 255, 0.88) 100%);
  border: 1px solid rgba(21, 36, 51, 0.08);
  box-shadow: 0 16px 28px rgba(21, 36, 51, 0.08);
}

.project-header-position {
  min-width: 240px;
  font-weight: 600;
  line-height: 1.6;
}

.project-header-select,
.project-header-note {
  border-radius: 18px;
  border: 1px solid rgba(21, 36, 51, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 250, 248, 0.96) 100%);
  box-shadow: 0 14px 28px rgba(21, 36, 51, 0.08);
  padding: 14px 16px;
  color: var(--text);
}

.project-header-current-name {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(21, 36, 51, 0.08);
  box-shadow: 0 10px 22px rgba(21, 36, 51, 0.06);
}

.project-header-current-name.is-set {
  background: linear-gradient(180deg, rgba(236, 250, 246, 0.98) 0%, rgba(255, 255, 255, 0.94) 100%);
}

.project-header-current-name.is-empty {
  background: linear-gradient(180deg, rgba(255, 248, 241, 0.98) 0%, rgba(255, 255, 255, 0.94) 100%);
}

.project-header-current-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-header-current-name strong {
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--accent-strong);
}

.project-header-select {
  min-height: 54px;
  appearance: none;
}

.project-header-note {
  min-height: 104px;
}

.project-header-select:focus,
.project-header-note:focus {
  outline: none;
  border-color: rgba(31, 138, 120, 0.45);
  box-shadow: 0 0 0 4px rgba(31, 138, 120, 0.12), 0 16px 30px rgba(21, 36, 51, 0.1);
}

.project-header-actions-row {
  margin-top: 18px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.form-field-full {
  grid-column: 1 / -1;
}

.compact-form-grid {
  align-items: end;
}

.project-filter-bar {
  margin-top: 0;
}

.top-gap-helper {
  margin-top: 20px;
}

.admin-hero-tight {
  margin-bottom: 10px;
}

.table-shell {
  margin-top: 24px;
  overflow-x: auto;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.data-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(21, 36, 51, 0.08);
}

.data-table th {
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  color: var(--accent-strong);
  background: rgba(255, 244, 236, 0.9);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.78);
}

.table-subtext {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.table-actions .icon-action-form {
  width: auto;
}

.table-actions .secondary-button,
.table-actions .danger-button {
  justify-content: center;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.pagination-pages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination-link {
  width: auto;
  min-width: 48px;
  flex: 0 0 auto;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

.pagination-link.is-active {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.pagination-link.is-disabled {
  cursor: default;
  opacity: 0.5;
  pointer-events: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon-action-button {
  min-width: 40px;
  width: 40px;
  min-height: 40px;
  padding: 0;
  justify-content: center;
}

.icon-action-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.table-number-cell {
  text-align: right !important;
  white-space: nowrap;
}

.data-table tfoot .table-total-row th,
.data-table tfoot .table-total-row td {
  background: rgba(12, 74, 110, 0.08);
  border-top: 2px solid rgba(12, 74, 110, 0.18);
  font-weight: 700;
}

.data-table tfoot .table-total-row th {
  text-align: left;
}

.thai-datetime-picker {
  cursor: pointer;
}

.flatpickr-calendar {
  font-family: 'Sarabun', 'Segoe UI', sans-serif;
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
}

.flatpickr-months .flatpickr-month,
.flatpickr-weekdays,
.flatpickr-days {
  font-family: 'Sarabun', 'Segoe UI', sans-serif;
}

.flatpickr-thai-current-month {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-family: 'Prompt', 'Sarabun', sans-serif;
  font-weight: 600;
  color: var(--text);
}

.flatpickr-time input.flatpickr-hour,
.flatpickr-time input.flatpickr-minute {
  font-weight: 700;
}

.dashboard-project-table th:first-child,
.dashboard-project-table td:first-child {
  width: 56px;
}

.dashboard-project-table th:nth-child(3),
.dashboard-project-table td:nth-child(3) {
  width: 26%;
}

.project-list-table {
  grid-column: span 12;
}

.project-results-anchor {
  scroll-margin-top: 18px;
}

.project-directory-guide {
  display: grid;
  gap: 18px;
}

.project-directory-intro {
  margin: 0;
}

.project-directory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.project-directory-filter-card {
  grid-column: auto;
  align-content: start;
  gap: 14px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.96) 0%, rgba(246, 252, 249, 0.9) 100%);
}

.project-directory-filter-head {
  display: grid;
  gap: 8px;
  padding-bottom: 6px;
}

.project-directory-filter-head .eyebrow {
  margin: 0;
}

.project-directory-filter-head h2 {
  margin: 0;
  font-size: 1.08rem;
  color: var(--ink-900);
}

.project-directory-filter-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.project-directory-card {
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(21, 36, 51, 0.08);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.project-directory-card-accent {
  background: linear-gradient(180deg, rgba(255, 247, 239, 0.92) 0%, rgba(245, 253, 250, 0.78) 100%);
}

.project-directory-card h2 {
  margin: 0 0 10px;
  font-size: 1.02rem;
  color: var(--ink-900);
}

.project-directory-card-text {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.7;
}

.project-directory-list {
  margin: 0;
  padding-left: 1.3rem;
  display: grid;
  gap: 8px;
  color: var(--ink-700);
  line-height: 1.7;
}

.projects-project-table {
  min-width: 960px;
}

.all-projects-table {
   min-width: 1300px;
}

.projects-project-table th:first-child,
.projects-project-table td:first-child {
  width: 56px;
}

.projects-project-table th:nth-child(3),
.projects-project-table td:nth-child(3) {
  width: 18%;
}

.projects-project-table th:nth-child(4),
.projects-project-table td:nth-child(4) {
  width: 32%;
}

.all-projects-table th:nth-child(8),
.all-projects-table td:nth-child(8) {
  width: 20%;
}

.assigned-projects-table th:nth-child(2),
.assigned-projects-table td:nth-child(2) {
  width: 10%;
}

.assigned-projects-table th:nth-child(3),
.assigned-projects-table td:nth-child(3) {
  width: 40%;
  min-width: 18rem;
}

.assigned-projects-table th:nth-child(4),
.assigned-projects-table td:nth-child(4),
.assigned-projects-table th:nth-child(5),
.assigned-projects-table td:nth-child(5),
.assigned-projects-table th:nth-child(6),
.assigned-projects-table td:nth-child(6) {
  width: 9%;
}

.assigned-projects-table th:nth-child(7),
.assigned-projects-table td:nth-child(7) {
  width: 22%;
  min-width: 20rem;
}

.project-code-link {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.project-code-link:hover,
.project-code-link:focus-visible {
  text-decoration: underline;
}

.table-link-button {
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.project-download-links {
  display: grid;
  gap: 8px;
  min-width: max-content;
}

.project-upload-cell {
  display: grid;
  gap: 8px;
  justify-items: start;
  min-width: max-content;
}

.project-download-link {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  width: fit-content;
  max-width: none;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #0b63c8;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.35;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  box-shadow: none;
  transition: color 0.18s ease;
  white-space: nowrap;
  flex: 0 0 auto;
}

.project-download-link:hover,
.project-download-link:focus-visible {
  color: #084a96;
}

.project-download-link svg {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.project-download-link span {
  display: inline;
  white-space: nowrap;
  overflow-wrap: normal;
}

.project-download-empty {
  color: var(--muted);
  white-space: nowrap;
}

.project-upload-action {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 14px;
  font-size: 0.9rem;
  white-space: nowrap;
  flex: 0 0 auto;
}

.project-table-details {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.project-table-title {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink-900);
  white-space: normal;
  overflow-wrap: anywhere;
}

.assigned-project-chairmen {
  margin-top: 0;
}

.project-table-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.project-table-meta-row span {
  display: inline-flex;
  align-items: center;
}

.project-table-meta-row span:not(:last-child)::after {
  content: '\2022';
  margin-left: 12px;
  color: rgba(21, 36, 51, 0.24);
}

.chairman-form-shell {
  margin-top: 28px;
}

.chairman-card {
  grid-column: span 6;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  cursor: pointer;
}

.chairman-card input {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.chairman-card strong {
  display: block;
  margin-bottom: 6px;
}

.chairman-actions-row {
  margin-top: 22px;
}

.empty-state-card {
  grid-column: 1 / -1;
}

.error-card {
  grid-column: span 8;
  padding: 34px;
}

.error-support-card {
  grid-column: span 4;
}

@media (max-width: 1080px) {
  .project-directory-hero-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-side-rail {
    position: static;
  }

  .hero-bento,
  .login-bento,
  .dashboard-top-grid,
  .profile-overview-grid,
  .profile-grid,
  .project-list,
  .dashboard-stats-grid,
  .dashboard-mini-list,
  .admin-bento-layout,
  .chairman-card-grid,
  .error-bento {
    grid-template-columns: 1fr;
  }

  .hero-panel-main,
  .hero-guide-card,
  .hero-year-card,
  .hero-feature-card,
  .auth-support-card,
  .auth-card-main,
  .dashboard-hero-tile,
  .dashboard-filter-card,
  .project-directory-hero,
  .profile-header-card,
  .profile-callout-card,
  .profile-card,
  .note-card,
  .project-card,
  .project-card-featured,
  .dashboard-stats-grid .stat-highlight-card,
  .mini-project-card,
  .mini-project-card-featured,
  .admin-panel,
  .admin-side-column,
  .chairman-card,
  .error-card,
  .error-support-card {
    grid-column: auto;
  }

  .login-bento > .auth-card-main:only-child {
    width: 100%;
    max-width: none;
    justify-self: stretch;
  }

  .profile-summary-head,
  .profile-summary-row {
    grid-template-columns: 1fr;
  }

  .profile-summary-card {
    padding: 24px;
  }

  .profile-edit-block {
    margin-top: 22px;
    padding-top: 20px;
  }

  .profile-summary-actions {
    margin-top: 22px;
    padding-top: 18px;
  }
}

@media (max-width: 980px) {
  .project-results-anchor {
    scroll-margin-top: 96px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .drawer-backdrop {
    position: fixed;
    inset: 0;
    display: block;
    border: 0;
    padding: 0;
    background: rgba(14, 22, 31, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    z-index: 35;
  }

  body.nav-open .drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .site-header {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(82vw, 360px);
    height: 100dvh;
    padding: 0;
    z-index: 40;
    transform: translateX(calc(-100% - 24px));
    transition: transform 0.24s ease;
    top: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }

  .site-header-scroll {
    padding: 18px 6px 18px 18px;
  }

  body.nav-open .site-header {
    transform: translateX(0);
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 252, 246, 0.88);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-soft);
  }

  .page-stage {
    gap: 16px;
  }

  .login-bento {
    min-height: auto;
    align-content: start;
    padding-block: 4px 8px;
  }
}

@media (max-width: 900px) {
  .admin-form-grid,
  .project-stats-grid {
    grid-template-columns: 1fr;
  }

  .project-directory-grid {
    grid-template-columns: 1fr;
  }

  .form-field-full {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 14px;
  }

  .header-brand-panel,
  .header-nav-panel,
  .hero-panel-main,
  .auth-support-card,
  .auth-card-main,
  .profile-header-card,
  .profile-card,
  .projects-hero,
  .dashboard-filter-card,
  .project-card,
  .admin-panel,
  .dashboard-list-panel,
  .stat-highlight-card,
  .mini-project-card,
  .error-card,
  .error-support-card,
  .admin-note-card,
  .info-card {
    padding: 22px;
  }

  .profile-header-card,
  .projects-hero,
  .project-directory-head,
  .dashboard-list-head,
  .mini-project-head,
  .project-card-top,
  .chairman-header-row {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-link,
  .nav-button,
  .secondary-button,
  .danger-button,
  .primary-button {
    width: 100%;
  }

  .table-pagination {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .table-pagination .pagination-pages {
    flex-wrap: nowrap;
    flex: 0 0 auto;
  }

  .table-pagination .pagination-link {
    width: auto;
  }

  .admin-nav-submenu {
    display: grid;
  }

  .mobile-topbar {
    padding: 12px 14px;
  }

  .menu-toggle-label {
    display: none;
  }

  .login-bento {
    padding-inline: 0;
    padding-block: 2px 6px;
  }

  .login-bento > .auth-card-main:only-child {
    width: 100%;
    max-width: 100%;
    justify-self: stretch;
  }

  .hero-copy h1,
  .auth-card h1,
  .profile-header-card h1,
  .error-card h1 {
    font-size: clamp(1.9rem, 10vw, 2.9rem);
  }

  .home-hero-showcase {
    gap: 20px;
  }

  .hero-guide-head {
    flex-direction: column;
  }

  .hero-guide-badge {
    width: 100%;
    min-width: 0;
  }

  .hero-carousel-stage {
    min-height: 250px;
    border-radius: 24px;
  }

  .hero-carousel-overlay {
    inset: auto 16px 16px 16px;
    padding: 16px 18px;
  }

  .hero-actions-inline {
    align-items: stretch;
  }

  .hero-actions-note {
    max-width: none;
  }

  .summary-chip {
    min-width: 100%;
  }
}

.confirm-dialog-popup {
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.confirm-dialog-popup,
.confirm-dialog-popup .swal2-title,
.confirm-dialog-popup .swal2-html-container,
.confirm-dialog-popup .swal2-styled {
  font-family: 'Sarabun', 'Segoe UI', sans-serif;
}

.confirm-dialog-popup .swal2-title {
  font-family: 'Prompt', 'Sarabun', sans-serif;
  color: var(--text);
}

.confirm-dialog-message,
.confirm-dialog-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.confirm-dialog-note {
  margin-top: 14px;
  font-size: 0.95rem;
}

.confirm-dialog-impact {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(227, 109, 69, 0.08);
  border: 1px solid rgba(227, 109, 69, 0.18);
  text-align: left;
}

.confirm-dialog-impact strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-family: 'Prompt', 'Sarabun', sans-serif;
}

.confirm-dialog-impact-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.65;
}

.confirm-dialog-actions {
  gap: 10px;
}

.confirm-dialog-confirm,
.confirm-dialog-cancel {
  min-width: 112px;
  border-radius: 14px;
  font-weight: 700;
}

