@import url("https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

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

:root {
  --primary: #00ff88;
  --secondary: #00d4ff;
  --danger: #ff4444;
  --warning: #ffaa00;
  --success: #00ff88;
  --dark: #0a0e27;
  --darker: #050714;
  --light: #ffffff;
  --gray: #8892b0;
  --purple: #9c88ff;
}

body {
  font-family: "Kanit", "Inter", system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #0a0e27 0%, #050714 100%);
  color: var(--light);
  min-height: 100vh;
  overflow-x: hidden;
  padding-top: 80px;
}

/* Cyber Grid Background */
.cyber-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(rgba(0, 255, 136, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 136, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridMove 20s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes gridMove {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(50px, 50px);
  }
}

/* Particles */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--primary);
  border-radius: 50%;
  animation: float 15s linear infinite;
  opacity: 0.6;
}

@keyframes float {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(10, 14, 39, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  z-index: 1000;
  border-bottom: 2px solid var(--primary);
  box-shadow: 0 4px 30px rgba(0, 255, 136, 0.3);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  color: var(--light);
  text-decoration: none;
  position: relative;
  transition: all 0.3s;
  padding: 0.5rem 1rem;
  border-radius: 5px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  background: rgba(0, 255, 136, 0.1);
}

/* Profile Container */
.profile-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
  position: relative;
  z-index: 100;
}

/* Profile Header */
.profile-header {
  background: rgba(10, 14, 39, 0.95);
  border: 2px solid var(--primary);
  border-radius: 20px;
  padding: 3rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(15px);
  box-shadow: 0 20px 60px rgba(0, 255, 136, 0.3);
  animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.avatar-section {
  display: flex;
  gap: 3rem;
  align-items: center;
}

.avatar-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
}

.avatar-image {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid var(--primary);
  object-fit: cover;
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
}

.avatar-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 0 0 50% 50%;
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.avatar-wrapper:hover .avatar-overlay {
  opacity: 1;
}

.change-avatar-btn {
  background: var(--primary);
  color: var(--dark);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.change-avatar-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.user-info {
  flex: 1;
}

.username {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.user-role {
  color: var(--gray);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.user-stats {
  display: flex;
  gap: 3rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary);
}

.stat-label {
  color: var(--gray);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Profile Content */
.profile-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.profile-section {
  background: rgba(10, 14, 39, 0.95);
  border: 2px solid rgba(0, 255, 136, 0.3);
  border-radius: 15px;
  padding: 2rem;
  backdrop-filter: blur(15px);
  animation: slideUp 0.6s ease-out;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(0, 255, 136, 0.2);
}

.section-header h2 {
  font-size: 1.5rem;
  color: var(--primary);
}

/* Form Styles */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  color: var(--light);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 1rem;
  background: rgba(0, 255, 136, 0.1);
  border: 2px solid rgba(0, 255, 136, 0.3);
  border-radius: 10px;
  color: var(--light);
  font-size: 1rem;
  transition: all 0.3s;
  outline: none;
}

.form-input:focus:not(:disabled) {
  border-color: var(--primary);
  background: rgba(0, 255, 136, 0.15);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.form-input:disabled {
  border: none;              /* เอากรอบออก */
  background: transparent;   /* เอาพื้นหลังสีเขียวจางๆ ออก */
  box-shadow: none;          /* เอาเงาเรืองแสงออก (ถ้ามี) */
  color: var(--gray);        /* (ทางเลือก) เปลี่ยนสีตัวอักษรให้ดูเป็นข้อมูลทั่วไป */
  opacity: 1;                /* ปรับให้ชัดขึ้นเพราะไม่มีกรอบแล้ว */
  cursor: default;           /* เปลี่ยน icon เมาส์เป็นลูกศรปกติ */
  padding-left: 0;           /* (ทางเลือก) ขยับข้อความให้ชิดซ้ายตรงกับ Label */
}

.form-hint {
  color: var(--gray);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-edit,
.btn-danger-outline {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  color: var(--dark);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 255, 136, 0.4);
}

.btn-secondary {
  background: rgba(136, 146, 176, 0.2);
  color: var(--light);
  border: 2px solid var(--gray);
}

.btn-secondary:hover {
  background: rgba(136, 146, 176, 0.3);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #ff2222;
  box-shadow: 0 10px 30px rgba(255, 68, 68, 0.4);
}

.btn-edit {
  background: rgba(0, 212, 255, 0.2);
  color: var(--secondary);
  border: 2px solid var(--secondary);
}

.btn-edit:hover {
  background: rgba(0, 212, 255, 0.3);
}

.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border: 2px solid var(--danger);
}

.btn-danger-outline:hover {
  background: rgba(255, 68, 68, 0.1);
}

.btn-full {
  width: 100%;
}

/* Security Section */
.security-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background: rgba(0, 255, 136, 0.05);
  border: 1px solid rgba(0, 255, 136, 0.2);
  border-radius: 10px;
  margin-bottom: 1rem;
}

.security-info h3 {
  color: var(--light);
  margin-bottom: 0.5rem;
}

.security-info p {
  color: var(--gray);
  font-size: 0.9rem;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 60px;
  height: 30px;
  display: inline-block;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(136, 146, 176, 0.3);
  transition: 0.4s;
  border-radius: 30px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--primary);
}

input:checked + .toggle-slider:before {
  transform: translateX(30px);
}

/* Danger Zone */
.danger-zone {
  border-color: var(--danger);
}

.danger-zone .section-header h2 {
  color: var(--danger);
}

.danger-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background: rgba(255, 68, 68, 0.05);
  border: 1px solid rgba(255, 68, 68, 0.3);
  border-radius: 10px;
}

.danger-item h3 {
  color: var(--danger);
  margin-bottom: 0.5rem;
}

.danger-item p {
  color: var(--gray);
  font-size: 0.9rem;
}

/* Warning Box */
.warning-box {
  background: rgba(255, 68, 68, 0.1);
  border: 2px solid var(--danger);
  border-radius: 15px;
  padding: 2rem;
  text-align: center;
}

.warning-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.warning-box h3 {
  color: var(--danger);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.warning-box p {
  color: var(--light);
  margin-bottom: 1rem;
}

.warning-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  text-align: left;
}

.warning-list li {
  color: var(--danger);
  padding: 0.5rem 0;
  font-weight: 500;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  background: rgba(10, 14, 39, 0.98);
  border: 2px solid var(--primary);
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 255, 136, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem;
  border-bottom: 2px solid rgba(0, 255, 136, 0.2);
}

.modal-header h2 {
  color: var(--primary);
  font-size: 1.5rem;
}

.close-btn {
  background: none;
  border: none;
  color: var(--gray);
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.3s;
}

.close-btn:hover {
  color: var(--danger);
  transform: rotate(90deg);
}

.modal-body {
  padding: 2rem;
}

/* Password Steps */
.password-step {
  display: none;
}

.password-step.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}
.password-step .form-group:last-of-type {
  margin-bottom: 2rem; /* Increases space below the input, pushing the button down */
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.step-description {
  color: var(--gray);
  margin-bottom: 2rem;
  text-align: center;
}

/* Password Input Wrapper */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper .form-input {
  padding-right: 3rem;
}

.toggle-password {
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.toggle-password:hover {
  transform: scale(1.1);
}

.eye-icon {
  color: var(--gray);
  transition: color 0.3s;
}

.toggle-password:hover .eye-icon {
  color: var(--primary);
}

/* OTP Input */
.otp-input-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.otp-input {
  width: 50px;
  height: 60px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: bold;
  background: rgba(0, 255, 136, 0.1);
  border: 2px solid rgba(0, 255, 136, 0.3);
  border-radius: 10px;
  color: var(--light);
  transition: all 0.3s;
}

.otp-input:focus {
  border-color: var(--primary);
  background: rgba(0, 255, 136, 0.15);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
  outline: none;
}

.otp-resend {
  text-align: center;
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.otp-resend a {
  color: var(--primary);
  text-decoration: none;
  font-weight: bold;
}

.otp-resend a:hover {
  text-decoration: underline;
}

/* Password Strength */
.password-strength {
  margin-top: 0.5rem;
}

.strength-indicator {
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.strength-bar {
  height: 100%;
  width: 0%;
  transition: all 0.3s;
  border-radius: 2px;
}

.strength-bar.weak {
  width: 33%;
  background: var(--danger);
}

.strength-bar.medium {
  width: 66%;
  background: var(--warning);
}

.strength-bar.strong {
  width: 100%;
  background: var(--success);
}

.password-strength span {
  font-size: 0.85rem;
  color: var(--gray);
}

.password-match {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.password-match.success {
  color: var(--success);
}

.password-match.error {
  color: var(--danger);
}

/* Success Icon */
.success-icon {
  font-size: 5rem;
  text-align: center;
  margin-bottom: 1rem;
}

#stepSuccess h3 {
  text-align: center;
  color: var(--primary);
  margin-bottom: 1rem;
}

#stepSuccess p {
  text-align: center;
  color: var(--gray);
  margin-bottom: 2rem;
}

/* โค้ดที่อยู่ด้านบนสุดของไฟล์ CSS (นอก Media Query) */

.hamburger-menu {
  display: none; /* <--- ใช้ !important เพื่อซ่อนใน Desktop */
}

/* ... (โค้ดอื่นๆ เช่น #hamburgerBtn:focus) ... */
/* ------------------------------------------------------------------ */
/* --- MEDIA QUERY สำหรับหน้าจอขนาดเล็ก (Mobile) [FINAL MERGED] --- */
/* ------------------------------------------------------------------ */

@media (max-width: 768px) {
  /* --- A. NAVIGATION BAR & HAMBURGER --- */

  /* 1. จัดโครงสร้าง nav-container บนมือถือ */
  .nav-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
  }

  /* 2. แสดงปุ่มแฮมเบอร์เกอร์และจัดตำแหน่ง */
  .hamburger-menu {
    display: block !important; /* <--- FIX: ต้องใช้ !important เพื่อบังคับให้แสดงผลใน Mobile */
    order: 2;
  }

  .logo {
    order: 1;
  }

  /* ปรับขนาดอิโมจิ Hamburger Button */
  #hamburgerBtn {
    background: transparent !important;
    border: none !important;
    appearance: none;
    -webkit-appearance: none;
    outline: none !important;
    box-shadow: none !important;
    font-size: 2rem; /* ปรับลดขนาด */
    color: var(--primary) !important;
    cursor: pointer;
    padding: 0.2rem 0.5rem 0.2rem 1rem !important;
  }

  /* 3. ซ่อนลิงก์เมนูหลักตามค่าเริ่มต้นบนมือถือ */
  .nav-links {
    display: none;
    width: 100%; /* บังคับให้เมนูเต็มความกว้างด้านล่าง */
    flex-direction: column; /* จัดเรียงลิงก์ในแนวตั้ง */
    align-items: center;
    padding-top: 1rem;
    order: 3; /* บังคับให้เมนูอยู่แถวล่างสุด */
  }

  /* 4. KEY: แสดงเมนูเมื่อ nav-container มีคลาส 'menu-active' */
  .nav-container.menu-active .nav-links {
    display: flex;
    padding-bottom: 1rem;
  }

  /* จัดการลิงก์ภายในเมนูสำหรับมือถือ */
  .nav-links .nav-link {
    padding: 0.5rem 0;
    width: 100%;
    text-align: center;
  }

  /* FIX: บังคับให้ Profile Pill และ Logout Button มีความกว้างที่เหมาะสมและจัดให้อยู่ตรงกลาง */
  .nav-links .profile-pill,
  .nav-links a[href="login.html"] {
    width: 90%;
    max-width: 300px; /* จำกัดความกว้างสูงสุด */
    margin: 0.5rem auto; /* จัดให้อยู่ตรงกลาง */
  }

  .nav-links .profile-pill {
    justify-content: center; /* จัด Avatar และ Username ให้อยู่ตรงกลางภายใน Pill */
    padding: 0.8rem 1.5rem; /* เพิ่ม padding ให้ดูดีขึ้น */
  }

  /* --- B. PROFILE PAGE LAYOUT & BUTTONS --- */

  .profile-container {
    padding: 0 1rem;
  }

  /* Admin Button Fix */
  #adminButtonContainer {
    top: 10px !important;
    right: 10px !important;
  }

  .btn-admin {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    box-shadow: 0 0 10px rgba(255, 0, 128, 0.3);
  }

  .btn-admin:hover {
    transform: scale(1.02);
  }

  /* Profile Header & Stats */
  .avatar-section {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }
  .username {
    font-size: 2rem; /* ลดขนาดชื่อผู้ใช้ */
  }
  .user-stats {
    justify-content: space-around;
    gap: 1rem;
  }

  /* Form & Section Layout */
  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .form-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
  .form-actions button {
    width: 100%;
  }

  /* Security & Danger Items */
  .security-item,
  .danger-item {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    padding: 1rem;
  }
  .security-item .toggle-switch {
    margin-top: 1rem;
  }

  /* Modal OTP Input */
  .otp-input-group {
    gap: 0.5rem;
  }
  .otp-input {
    width: 40px;
    height: 50px;
    font-size: 1.2rem;
  }
}
/* --- เพิ่มใน profile.css --- */

/* 1. จัดตำแหน่งปุ่มมุมขวาบน (Logout & Admin) */
.header-actions {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
}

/* 2. สไตล์ปุ่ม Logout ใหม่ใน Header */
.btn-logout-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Kanit', sans-serif;
}

.btn-logout-header:hover {
  background: var(--danger);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 68, 68, 0.3);
}

/* ปรับปุ่ม Admin เดิมให้เข้ากับ Layout ใหม่ */
#adminButtonContainer {
  position: static !important; /* ยกเลิก absolute เดิม */
}
.btn-admin {
  /* ลบ style inline เดิมใน html ออกแล้วใช้ class นี้แทนจะสะอาดกว่า */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #ff0080, #ff8c00);
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  border: none;
  transition: all 0.3s ease;
}

/* 3. สไตล์ Profile Pill ใน Navbar (ให้เหมือน Index) */
.nav-user-area {
  display: flex;
  align-items: center;
}

.profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 1rem 0.3rem 0.3rem; /* ปรับ padding ให้สมดุลกับรูป */
  border-radius: 50px;
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  text-decoration: none;
  color: var(--light);
  font-weight: 500;
  transition: all 0.3s ease;
}

.profile-pill:hover {
  background: rgba(0, 255, 136, 0.2);
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

#navUsername {
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 0.5rem;
}

/* 4. Responsive Mobile (แก้ Media Query เดิม) */
@media (max-width: 768px) {
  /* ปรับให้ปุ่ม Logout/Admin ไหลลงมา ไม่ซ้อนกัน */
  .header-actions {
    position: static;
    margin-bottom: 1.5rem;
    width: 100%;
    justify-content: center;
    flex-direction: column; /* เรียงแนวตั้งในมือถือ */
  }

  .btn-logout-header, .btn-admin {
    width: 100%;
    justify-content: center;
  }
  
  /* จัดการ Profile Pill ในเมนูมือถือ */
  .nav-user-area {
    width: 100%;
    justify-content: center;
    margin: 0.5rem 0;
  }
}
