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

body {
  font-family: 'Kanit', sans-serif;
}

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

body {
  font-family: 'Kanit', sans-serif;
}

/* ===== INDEX ===== */
:root{
  --bg: #ffffff;
  --text: #0f172a;            /* slate-900 */
  --muted: #475569;           /* slate-600 */
  --primary: #0b5ed7;         /* blue */
  --primary-ghost: #e6eefc;
  --accent: #123e7a;          /* deep navy for CTA */
  --shadow: 0 10px 30px rgba(0,0,0,.12);
  --radius: 14px;
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: "Kanit", system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

/* ===== Topbar ===== */
.topbar{
  width:100%;
  height:76px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding: 10px 24px;
  background:#fff;
  box-shadow: 0 1px 0 rgba(15,23,42,.06);
  position:sticky;
  top:0;
  z-index: 10;
}

.brand{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}
.brand-mark{
  height:44px;
  width:auto;
  object-fit:contain;
}
.brand-text{
  display:flex;
  flex-direction:column;
  font-weight:500;
  line-height:1.1;
  letter-spacing:.2px;
  color:#1f2937;
}
.brand-line:first-child{ font-size:15px; }
.brand-line:last-child{ font-size:15px; }

/* Auth buttons */
.auth-actions{
  display:flex;
  align-items:center;
  gap:10px;
}
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 16px;
  border-radius: 999px;
  font-weight:600;
  text-decoration:none;
  transition: all .18s ease;
  white-space: nowrap;
}
.btn-ghost{
  background: transparent;
  border:1px solid rgba(15,23,42,.12);
  color: var(--text);
}
.btn-ghost:hover{
  background: var(--primary-ghost);
  border-color: rgba(11,94,215,.35);
}
.btn-primary{
  background: var(--primary);
  color:#fff;
  border:1px solid var(--primary);
  box-shadow: var(--shadow);
}
.btn-primary:hover{ filter: brightness(.95); }
.btn-accent{
  background: var(--accent);
  color:#fff;
  border:1px solid var(--accent);
  box-shadow: var(--shadow);
}
.btn-accent:hover{ filter: brightness(.95); }

/* ===== Hero ===== */
.hero{
  position:relative;
  min-height: calc(100vh - 76px);
  display:grid;
  place-items: center start;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  isolation:isolate;
}
.hero::before{
  content:"";
  position:absolute; inset:0;
  /* ซ้อนโทนมืดเล็กน้อย + ไล่สว่างจากซ้ายให้ตัวอักษรอ่านง่าย */
  background: linear-gradient(90deg, rgba(8,16,32,.65) 0%, rgba(8,16,32,.35) 40%, rgba(8,16,32,.15) 70%, rgba(8,16,32,0) 100%);
  z-index:-1;
}
.hero-inner{
  width:min(1100px, 92vw);
  padding: 64px 24px;
  color:#fff;
}
.hero-title{
  margin: 0 0 12px;
  font-size: clamp(28px, 5vw, 44px);
  font-weight:700;
  letter-spacing:.4px;
}
.hero-sub{
  margin:0 0 22px;
  font-size: clamp(16px, 2.2vw, 20px);
  color: #e5e7eb;
}

/* ===== Responsive ===== */
@media (max-width: 720px){
  .brand-text{ display:none; }        /* เหลือแค่โลโก้บนจอเล็ก */
  .topbar{ padding:10px 16px; }
  .brand-mark{ height:40px; }
  .hero-inner{ padding: 48px 18px; }
}

/* =========================================
   User Sidebar (prefix: us-)
   ========================================= */
:root {
  /* us- = ตัวแปรของ Sidebar */
  --us-bg1: #0A3570;
  --us-bg2: #072E61;
  --us-text: #FFFFFF;
  --us-hover: rgba(255,255,255,0.12);
  --us-active: rgba(255,255,255,0.22);
  --us-radius: 12px;

  /* um- = ตัวแปรของ Main/Dashboard */
  --um-bg: #F6F8FB;
  --um-card: #FFFFFF;
  --um-border: #E7ECF3;
  --um-text: #0F172A;
  --um-muted: #6B7280;
  --um-primary: #5B75F0;
  --um-shadow: 0 8px 24px rgba(15,23,42,.06);
  --um-radius: 14px;
}

*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: "Kanit", system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---- Sidebar ---- */
.us-sidebar{
  width: 260px;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--us-bg1), var(--us-bg2));
  color: var(--us-text);
  display:flex;
  flex-direction:column;
  padding: 16px 20px 24px;
}
.us-sidebar-brand{
  display:flex; align-items:center; gap:10px;
  padding-bottom:14px; border-bottom:1px solid rgba(255,255,255,.15);
}
.us-brand-logo{ height:40px; width:auto; object-fit:contain; }
.us-brand-caption{ display:flex; flex-direction:column; font-size:14px; color:#E5EEFF; line-height:1.15; }

.us-hamburger{
  width:44px;height:44px;margin:14px 0 8px 4px;
  border:1px solid rgba(255,255,255,.2);
  border-radius: var(--us-radius);
  background:transparent; color:#fff; display:grid; place-items:center; cursor:pointer;
}
.us-hamburger:hover{ background: var(--us-hover); }

.us-menu{ display:flex; flex-direction:column; gap:8px; margin-top:10px; }
.us-menu-item{
  display:flex; align-items:center; gap:12px;
  padding:10px 14px; border-radius: var(--us-radius);
  color:#fff; text-decoration:none; transition:background .2s ease;
}
.us-menu-item .us-icon{ width:20px; height:20px; display:grid; place-items:center; }
.us-menu-item:hover{ background: var(--us-hover); }
.us-menu-item.active{ background: var(--us-active); }

/* =========================================
   User Main / Dashboard (prefix: um-)
   ========================================= */

.um-body{ background: var(--um-bg); }
.um-layout{ display:flex; min-height:100vh; }

.um-main{
  flex:1;
  padding: 22px 24px;
  background: var(--um-bg);
}

.um-grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

/* Columns helper */
.um-col-12{ grid-column: span 12; }
.um-col-6 { grid-column: span 6; }
.um-col-3 { grid-column: span 3; }

@media (max-width: 1100px){
  .um-col-6{ grid-column: span 12; }
  .um-col-3{ grid-column: span 6; }
}
@media (max-width: 720px){
  .um-grid{ gap:14px; }
  .um-col-3, .um-col-6, .um-col-12{ grid-column: span 12; }
}

/* Card */
.um-card{
  background: var(--um-card);
  border: 1px solid var(--um-border);
  border-radius: var(--um-radius);
  box-shadow: var(--um-shadow);
  padding: 18px;
}
.um-card-title{
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--um-text);
  font-weight: 600;
  display:flex; align-items:center; gap:8px;
}

.um-ico{ font-style: normal; }

/* Personal block */
.um-personal{ display:flex; gap:16px; }
.um-avatar{
  width:120px; height:120px; background:#D9D9D9; border-radius:10px; flex-shrink:0;
}
.um-info{
  list-style:none; padding:0; margin:0;
  display:grid; grid-template-columns: 1fr; gap:6px; font-size:14px;
}
.um-info strong{ font-weight:600; }

/* Next appointment */
.um-center{ display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; }
.um-next-apt{ display:flex; align-items:baseline; gap:16px; }
.um-next-apt-day{ font-size:56px; font-weight:700; color: var(--um-text); line-height:1; }
.um-next-apt-meta{ color: var(--um-muted); }

/* Notifications */
.um-stack{ display:flex; flex-direction:column; gap:10px; }
.um-chip{
  background:#fff; color: var(--um-text);
  border:1px solid var(--um-border);
  padding:10px 12px; border-radius: 10px;
  text-align:left; cursor:default;
}

/* Progress */
.um-progress{
  width:100%; height:14px; border-radius:999px;
  background:#D7DADF; overflow:hidden; margin-bottom:10px;
  border:1px solid var(--um-border);
}
.um-progress-bar{
  height:100%; background: var(--um-primary);
  border-right: 1px solid rgba(0,0,0,.08);
}

/* muted text & placeholder */
.um-muted{ color: var(--um-muted); font-size:14px; }
.um-placeholder{ color: var(--um-muted); }

/* Small tweaks */
@media (max-width: 480px){
  .um-personal{ flex-direction:column; }
  .um-avatar{ width:100%; height:160px; }
}

/* user_exercise */
/* ====== Layout (ซ้าย-ขวา) ====== */
.layout-wrap{ display:flex; min-height:100vh; min-height:100dvh; }
.us-sidebar{
  width:260px; border-right:1px solid rgba(15,23,42,.08);
  position:sticky; top:0; height:100vh; height:100dvh; overflow-y:auto; flex-shrink:0;
}
@media (max-width:1200px){ .us-sidebar{ width:240px; } }
@media (max-width:992px){  .us-sidebar{ width:220px; } }
/* @media (max-width:768px){  .us-sidebar{ position:fixed; left:0; top:0; z-index:1030; } } */

.content{ flex:1; min-width:0; }
.content-inner{ width:min(1200px,100%); margin:0 auto; padding:clamp(12px,2.4vw,32px); }

/* ====== Cards / Chips ====== */
.plan-card{ border-radius: var(--radius); }
.rounded-16{ border-radius:16px; }

.chip{
  display:inline-block; padding:6px 12px; border-radius:999px;
  font-size:.85rem; line-height:1; border:1px solid rgba(15,23,42,.12);
  background:#fff; color:#475569;
}
.chip-success{ background:#e8f7ed; color:#177245; border-color:#bde7ca; }
.chip-muted  { background:#f1f5f9; color:#475569; border-color:#e2e8f0; }

/* ====== Daily Goal (ปรับสี) ====== */
.daily-goal .goal-meta{ color:#64748b; font-size:.9rem; }
.daily-goal .progress{ height:12px; background:#e5e7eb; border-radius:999px; }
.daily-goal .progress-bar{
  background: #5865f2;           /* อินดิโก้-น้ำเงิน อ่านง่าย */
  border-radius:999px;
}

/* วงบอกวัน: วงสีรอบนอก + แผ่นในสีขาว */
.day-ring-block{ text-align:center; }
.day-ring{
  --ring:#5865f2;                 /* สี default */
  --pct: 75;                      /* เผื่ออยากทำเป็นเปอร์เซ็นต์ภายหลัง */
  width:42px; height:42px; border-radius:50%;
  background:
    conic-gradient(var(--ring) calc(var(--pct)*1%), #e5e7eb 0);
  display:grid; place-items:center;
  box-shadow: 0 0 0 3px #f3f4f6 inset;    /* วงด้านในอ่อน */
}
.day-ring > span{
  width:30px; height:30px; border-radius:50%;
  background:#fff; display:grid; place-items:center;
  font-weight:600; color:#334155; font-size:.9rem;
  box-shadow: 0 1px 0 rgba(0,0,0,.06);
}
.day-label{ font-size:.78rem; margin-top:.25rem; color:#64748b; }

/* โทนสีวงต่อวัน */
.ring-pink   { --ring:#ec4899; }  /* จันทร์ */
.ring-yellow { --ring:#f59e0b; }  /* อังคาร */
.ring-green  { --ring:#22c55e; }  /* พุธ */
.ring-orange { --ring:#fb923c; }  /* พฤหัสฯ */
.ring-blue   { --ring:#38bdf8; }  /* ศุกร์ */
.ring-purple { --ring:#8b5cf6; }  /* เสาร์ */
.ring-red    { --ring:#ef4444; }  /* อาทิตย์ */

/* Appointment Calendar */
.appt-cal{ min-height: 360px; }
.appt-cal__header{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:12px;
}
.appt-cal__title{ font-weight:600; }
.appt-cal__grid{
  display:grid; grid-template-columns: repeat(7, 1fr);
  gap:6px;
}
.appt-cal__dow{
  text-align:center; font-weight:600; color:#64748b; padding:6px 0;
}
.appt-cal__cell{
  background:#fff; border:1px solid #e5e7eb; border-radius:10px;
  padding:8px; min-height:68px; position:relative; cursor:default;
}
.appt-cal__cell--blank{ background:transparent; border:none; }
.appt-cal__date{ font-weight:600; color:#111827; }
.appt-cal__cell.is-today{ outline:2px solid #3b82f6; }
.appt-cal__cell.has-events{ border-color:#c7d2fe; box-shadow:0 0 0 2px rgba(59,130,246,.1) inset; cursor:pointer; }
.appt-cal__dots{
  position:absolute; right:8px; bottom:8px; width:8px; height:8px;
  background:#3b82f6; border-radius:50%;
}
.appt-cal__details{
  margin-top:12px; padding:10px; background:#f8fafc; border:1px solid #e5e7eb; border-radius:10px;
}
.appt-cal__event{ padding:6px 0; color:#334155; }

/* End of user_exercise */

/* header */

  .us-header {
    background: #fff;
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
  }
  .us-header-title {
    font-size: 18px;
    font-weight: 600;
    color: #111;
  }
  .us-header-btn {
    background: #0d2e67;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    transition: .2s;
  }
  .us-header-btn:hover {
    background: #123b7a;
  }

  /* Modal ปุ่มแต่ละช่องทาง */
  .btn-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-weight: 500;
    font-size: 15px;
    height: 44px;
  }
  .btn-contact.fb {
    background: #e9f3ff;
    color: #1877f2;
  }
  .btn-contact.phone {
    background: #e5ffea;
    color: #119d26;
  }
  .btn-contact.line {
    background: #d7ffd9;
    color: #00c300;
  }
  .btn-contact.wa {
    background: #c7f7cd;
    color: #25d366;
  }