/* ================= RESET & BOX-SIZING ================= */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ================= VARIABLES ================= */
:root {
  --primary: #f57c00;
  --primary-hover: #000080;
  --secondary: #162362;
  --bg: #f5f5f5;
  --menu-bg: #e6f8fa;
}

@font-face {
  font-family: 'Kanit';
  src: url('https://www.ubroker.co.th/fonts/SukhumvitSet-Text.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Kanit';
  src: url('https://www.ubroker.co.th/fonts/SukhumvitSet-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ================= BODY ================= */
body {
  display: flex;
  font-family: 'Kanit', sans-serif;
  background: var(--bg);
  color: #333;
  height: 100vh;
  overflow: hidden;
}

/* ================= HIDE MOBILE PARTS ON DESKTOP ================= */
.mobile-top,
.bottom-nav {
  display: none;
}

/* ================= SIDEBAR ================= */
.sidebar {
  width: 280px;
  background: var(--primary);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 0px;
  text-align: center;
}
.sidebar-logo img {
  width: 120px;
}
.profile {
  padding: 0px 20px;
  text-align: center;
}
.profile img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid #fff;
}
.profile-info {
  margin-top: 0px;
}
.profile-name {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 5px;
}
.btn-profile {
  font-size: 14px;
  padding: 5px 15px;
  color: #fff;
  background: transparent;
  border: 1px solid #fff;
  border-radius: 20px;
  cursor: pointer;
	font-family: 'Kanit', sans-serif;
}

/* ================= NAV MENU ================= */
.nav-menu ul {
  list-style: none;
  margin-top: 20px;
}
.nav-menu > ul > li {
  position: relative;
  margin: 6px 0;
}
.nav-menu > ul > li > a {
  display: flex;
  align-items: center;
  padding: 8px 20px;
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  line-height: 1.5;
  transition: background 0.2s;
}
.nav-menu > ul > li.active > a,
.nav-menu > ul > li > a:hover {
  background: var(--primary-hover);
}
.nav-menu i {
  margin-right: 12px;
  font-size: 18px;
}

.nav-menu hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 0.5rem 0;
}

/* ================= SUBMENU ================= */
.submenu {
  display: none;
  list-style: none;
  margin-top: 2px;
  padding: 0;
  background: none;
}
.nav-menu li.open .submenu {
  display: block;
}
.submenu li {
  margin: 6px 0;
}
.submenu li a {
  display: block;
  padding: 8px 40px;
  color: #fff;
  font-size: 14px;
  line-height: 1.6;
  text-decoration: none;
}

/* ================= MAIN CONTENT ================= */
.main-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  position: relative;
	background-color: #FFF;
}

  .mobile-top-fix {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
  }


/* ================= BANNER SLIDER ================= */
.banner {
  position: relative;
  margin: -20px -20px;
  width: calc(100% + 40px);
 /* height: 200px; */
  overflow: hidden;
}
.banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.banner-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}
.banner-dots .dot {
  width: 8px;
  height: 8px;
  background: rgba(255,255,255,0.7);
  border-radius: 50%;
  cursor: pointer;
}
.banner-dots .dot.active {
  background: var(--secondary);
}
.banner-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.7);
  border: none;
  padding: 6px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
}
.banner-arrow.left {
  left: 20px;
}
.banner-arrow.right {
  right: 20px;
}

/* ================= WORK TABS ================= */
.work-tabs {
  display: flex;
  gap: 16px;
  margin-top: 40px;
}
.tab {
  flex: 1;
  border: 0px solid #ccc;
  border-radius: 8px;
  padding: 16px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
	color: #000;
  cursor: pointer;
  transition: border-color 0.2s;
	font-family: 'Kanit', sans-serif;
}
.tab.active {
  border-color: var(--primary);
}

.v-home{
		font-size: 25px;
	}

/* ================= OTHER MENU GRID ================= */
.other-menu-title {
  margin: 30px 0 12px;
  font-size: 18px;
}
.other-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
	padding-top: 20px;
}
.menu-item {
  position: relative;
  border-radius: 8px;
  padding: 20px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #FFF;
  font-size: 14px;
  cursor: pointer;
	background: linear-gradient(to right, #f68b1e, #c1a43f);
	box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
	
}
.menu-item i {
  font-size: 28px;
  margin-bottom: 8px;
}
.menu-item .badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--secondary);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}


.menu-item-two {
  position: relative;
  border-radius: 8px;
  padding: 20px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #FFF;
  font-size: 14px;
  cursor: pointer;
	background: linear-gradient(to right, #000080, #4040b8);
	box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
	
}
.menu-item-two i {
  font-size: 28px;
  margin-bottom: 8px;
}
.menu-item-two .badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--secondary);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}





/* ซ่อนปุ่ม X บน Desktop */
.close-sidebar {
  display: none;
}

/* ================= RESPONSIVE: TABLET (≤1024px) ================= */
@media screen and (max-width: 1024px) {
	body{
		font-family: 'Kanit', sans-serif;
	}
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary);
    color: #fff;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    padding-top: 50px; /* เว้นพื้นที่ top bar */
    overflow-y: auto;
  }

  /* เมื่อมีคลาส .open ให้สไลด์เข้ามา */
  .sidebar.open {
    transform: translateX(0);
  }
  /* ปุ่ม X ปิด */
  .close-sidebar {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
	  display: block;
  }
  .main-content {
    position: fixed;
    top: 38px;     /* ระยะจากด้านบน เท่ากับ header สูง */
    bottom: 56px;  /* ระยะจากด้านล่าง เท่ากับ footer สูง */
    left: 0;
    right: 0;
    padding: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* เปิด momentum scrolling บน iOS */
    background-color: #FFF;
  }
  .banner {
    margin: -16px -16px;
    width: calc(100% + 32px);
   /* height: 180px; */
  }
  .work-tabs {
    gap: 12px;
    margin-top: 25px;
  }
  .tab {
    padding: 12px;
    font-size: 14px;
	  font-family: 'Kanit', sans-serif;
  }
	.v-home{
		font-size: 18px;
		font-weight: 500;
	}
  .other-menu-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 16px;
  }
  .menu-item {
    padding: 16px 8px;
    font-size: 12px;
  }
	.menu-item-two {
    padding: 16px 8px;
    font-size: 12px;
  }
  .bottom-nav {
    display: none;
  }
	
	/* ================= MOBILE TOP BAR ================= */
.mobile-top {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
}
.mobile-top .hamburger {
  font-size: 24px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
	margin-left: -10px;
}
.mobile-top .logo img {
  height: 60px;
	margin-top: 8px;
}
.mobile-top .user-info {
  font-size: 12px;
  text-align: right;
  line-height: 1.2;
}
.mobile-top .user-name {
	font-size: 16px;
}
.mobile-top .user-code {
	font-size: 18px;
	padding-top: 5px;
}
	
	/* ================= BOTTOM NAVIGATION ================= */
.bottom-nav {
  position: fixed;
  bottom: -12px;
  left: 0;
  width: 100%;
  background: #fff;
  border-top: 1px solid #ddd;
  z-index: 100;
  display: flex;
}
.bottom-nav a {
  flex: 1;
  text-align: center;
  padding: 9px 0;
  text-decoration: none;
  color: rgba(0,0,0,0.5);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.bottom-nav a i {
  font-size: 20px;
  margin-bottom: 2px;
}
.bottom-nav a.active,
.bottom-nav a:hover {
  color: var(--primary);
}
	
	/* === ปรับขนาดและตำแหน่งไอคอนเช็คเบี้ย === */
.bottom-nav a.check-premium {
  position: relative;
  top: -21px;             /* ยกไอคอนขึ้นเหนือบาร์ */
  padding-bottom: 0;      /* ลด padding ล่าง เพื่อไม่ให้บาร์สูงขึ้น */
}

.bottom-nav a.check-premium img {
  width: 90px;            /* ปรับขนาดตามต้องการ */
  height: auto;
  display: block;         /* ให้ span มาชิดใต้ภาพ */
  margin: 0 auto -8px;     /* จัดกึ่งกลางและเว้นช่องเล็กน้อย */
}

.bottom-nav a.check-premium span {
  font-size: 10px;        /* ปรับขนาดข้อความเล็กลงถ้าจำเป็น */
  line-height: 1;
}
	
}

/* ================= RESPONSIVE: MOBILE (≤480px) ================= */
@media screen and (max-width: 480px) {
	body{
		font-family: 'Kanit', sans-serif;
	}
  .banner {
    margin: 10px -12px;
    width: calc(100% + 24px);
   
  }
  .work-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 0px;
  }
  .tab {
    padding: 10px;
    font-size: 11px;
	  font-family: 'Kanit', sans-serif;
  }
	
  .other-menu-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px 20px;
  }
  .menu-item {
    padding: 8px 4px;
    font-size: 12px;
  }
	.menu-item-two {
    padding: 8px 4px;
    font-size: 12px;
  }
  .bottom-nav {
    display: flex;
  }
}
