:root{
  --blue:#154181;
  --blue-dark:#103568;
  --page:#f7f7f4;
  --card:#ffffff;
  --text:#1f1f1f;
  --muted:#77736b;
  --muted-2:#9b978e;
  --line:#ebe8df;
  --line-dark:rgba(255,255,255,.08);
  --sidebar:#154181;
  --sidebar-2:#154181;
  --hover-dark:rgba(255,255,255,.06);
  --soft:#fbfbf8;
  --radius:10px;
  --sidebar-width:278px;
  --topbar-height:82px;
}

*{box-sizing:border-box}
html,body{
  margin:0;
  min-height:100%;
  background:var(--page);
  color:var(--text);
  font-family:'Kanit', Arial, sans-serif;
  font-weight:300;
  -webkit-font-smoothing:antialiased;
  text-rendering:geometricPrecision;
  overflow-x:hidden;
}
html{-webkit-tap-highlight-color:transparent;scrollbar-width:thin;scrollbar-color:#c7c2b8 #f5f3ee}
body::-webkit-scrollbar,.app-content::-webkit-scrollbar,.app-sidebar-nav::-webkit-scrollbar{width:12px;height:12px}
body::-webkit-scrollbar-track,.app-content::-webkit-scrollbar-track{background:#f5f3ee}
body::-webkit-scrollbar-thumb,.app-content::-webkit-scrollbar-thumb{background:#c7c2b8;border-radius:999px;border:3px solid #f5f3ee}
body::-webkit-scrollbar-thumb:hover,.app-content::-webkit-scrollbar-thumb:hover{background:#b7b0a4}
.app-sidebar-nav{scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.45) rgba(255,255,255,.08)}
.app-sidebar-nav::-webkit-scrollbar{width:11px}
.app-sidebar-nav::-webkit-scrollbar-track{background:rgba(255,255,255,.07);border-radius:999px}
.app-sidebar-nav::-webkit-scrollbar-thumb{background:linear-gradient(180deg,rgba(255,255,255,.56) 0%,rgba(190,220,255,.40) 100%);border-radius:999px;border:2px solid rgba(21,65,129,.32);box-shadow:inset 0 0 0 1px rgba(255,255,255,.08)}
.app-sidebar-nav::-webkit-scrollbar-thumb:hover{background:linear-gradient(180deg,rgba(255,255,255,.72) 0%,rgba(190,220,255,.58) 100%)}
.app-sidebar-nav::-webkit-scrollbar-corner{background:transparent}

a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit}

.overlay{
  position:fixed;inset:0;background:rgba(15,15,15,.48);opacity:0;visibility:hidden;transition:.25s ease;z-index:70;
}
.menu-open .overlay{opacity:1;visibility:visible}

.app-shell{
  min-height:100vh;
  background:var(--page);
}

.app-sidebar{
  position:fixed;
  inset:0 auto 0 0;
  width:var(--sidebar-width);
  background:var(--blue);
  color:#fff;
  border-right:1px solid var(--line-dark);
  display:flex;
  flex-direction:column;
  z-index:90;
}

.app-brand{
  height:84px;
  min-height:84px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:0 18px;
  border-bottom:1px solid var(--line-dark);
}
.brand-wrap{
  display:flex;align-items:center;gap:12px;min-width:0;
}
.brand-logo{
  width:47px;
  min-width:47px;
  height:47px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.brand-logo img{
  width:47px;
  max-width:47px;
  height:auto;
  display:block;
  object-fit:contain;
}
.brand-copy strong{
  display:block;
  color:#fff;
  font-size:15px;
  line-height:1.05;
  font-weight:400;
  letter-spacing:-.02em;
}
.brand-copy span{
  display:block;
  margin-top:4px;
  color:rgba(255,255,255,.50);
  font-size:11px;
  line-height:1.2;
  font-weight:300;
}
.sidebar-close{
  display:none;
  width:42px;height:42px;border:1px solid transparent;background:transparent;color:rgba(255,255,255,.72);cursor:pointer;border-radius:10px;
}
.sidebar-close:hover{background:var(--hover-dark);color:#fff}

.app-sidebar-nav{
  flex:1;
  min-height:0;
  overflow:auto;
  padding:18px 14px;
}
.menu-group{margin-bottom:18px}
.menu-title{
  padding:0 13px 10px;
  color:rgba(255,255,255,.35);
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-weight:400;
}
.menu-item{
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 13px;
  color:rgba(255,255,255,.68);
  font-size:15px;
  font-weight:300;
  border:1px solid transparent;
  border-radius:0;
  transition:background .15s ease,color .15s ease,border-color .15s ease;
}
.menu-item:hover,
.menu-item.active{
  background:var(--hover-dark);
  color:#fff;
  border-color:rgba(255,255,255,.03);
}
.menu-item.active{font-weight:400}
.menu-item small{
  font-size:11px;color:rgba(255,255,255,.38);font-weight:300;
}

.main{
  margin-left:var(--sidebar-width);
  min-height:100vh;
  width:calc(100% - var(--sidebar-width));
  background:var(--page);
}

.topbar{
  position:sticky;
  top:0;
  z-index:60;
  height:var(--topbar-height);
  min-height:var(--topbar-height);
  background:var(--blue);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 30px;
  border-bottom:1px solid rgba(255,255,255,.10);
}
.top-left{display:flex;align-items:center;gap:14px;min-width:0}
.menu-toggle{
  display:none;
  width:44px;height:44px;min-width:44px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.08);color:#fff;border-radius:10px;cursor:pointer;
}
.menu-toggle:hover{background:rgba(255,255,255,.12)}
.top-copy{min-width:0}
.top-copy h1{margin:0;color:#fff;font-size:24px;line-height:1.05;font-weight:400;letter-spacing:-.02em}
.top-copy p{margin:5px 0 0;color:rgba(255,255,255,.78);font-size:13px;line-height:1.3;font-weight:300}
.top-actions{display:flex;align-items:center;gap:8px}
.user-menu{position:relative}
.user-trigger{
  width:100px;
  height:46px;
  min-height:46px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:5px 13px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.08);
  color:#fff;
  border-radius:100%;
  cursor:pointer;
  transition:background .15s ease,border-color .15s ease;
}
.user-trigger:hover,.user-menu.open.user-trigger{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.20)}
.user-avatar{
  width:34px;
  height:34px;
  min-width:34px;
  border-radius:100%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#fff;
  color:var(--blue);
  font-size:12px;
  font-weight:500;
  letter-spacing:.02em;
}
.user-meta{
  text-align:left;
  min-width:0;
  overflow:hidden;
}
.user-meta strong{
  display:block;
  color:#fff;
  font-size:12px;
  line-height:1;
  font-weight:400;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.user-dropdown{
  position:absolute;
  top:calc(100% + 10px);
  right:0;
  width:250px;
  padding:10px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:10px;
  box-shadow:0 14px 34px rgba(24,39,64,.16);
  opacity:0;
  visibility:hidden;
  transform:translateY(-6px);
  transition:opacity .18s ease,transform .18s ease,visibility .18s ease;
  z-index:120;
}
.user-menu.open .user-dropdown{opacity:1;visibility:visible;transform:translateY(0)}
.user-dropdown-head{display:flex;align-items:center;gap:11px;padding:8px}
.user-avatar-large{width:42px;height:42px;min-width:42px;border-radius:50%;background:#edf2fb}
.user-dropdown-head strong{display:block;color:var(--text);font-size:14px;line-height:1.2;font-weight:400}
.user-dropdown-head small{display:block;margin-top:4px;color:var(--muted);font-size:12px;line-height:1.2;font-weight:300}
.user-dropdown-line{height:1px;background:var(--line);margin:6px 0}
.logout-link{
  min-height:42px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 10px;
  border-radius:8px;
  color:#9f2e2e;
  font-size:13px;
  font-weight:400;
  transition:background .15s ease,color .15s ease;
}
.logout-link:hover{background:#fff4f4;color:#7f2020}

.app-content{padding:22px 22px 26px}

.hero-card,
.card,
.panel{
  background:#fff;
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:none;
}

.hero-card{
  padding:22px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:16px;
}
.hero-copy h2{
  margin:0;
  color:var(--text);
  font-size:22px;
  line-height:1.1;
  font-weight:400;
  letter-spacing:-.03em;
}
.hero-copy p{
  margin:7px 0 0;
  color:var(--muted);
  font-size:14px;
  line-height:1.5;
}
.hero-badge{
  display:inline-flex;align-items:center;gap:8px;height:38px;padding:0 14px;border-radius:999px;background:#edf2fb;color:var(--blue);font-size:13px;font-weight:300;border:1px solid #dce6f8;white-space:nowrap;
}
.hero-badge i{width:8px;height:8px;background:var(--blue);border-radius:50%;display:inline-block}

.stats-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
  margin-bottom:16px;
}
.card{
  padding:20px;
}
.card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;min-height:106px}
.card-label{margin:0 0 8px;color:var(--muted);font-size:14px;line-height:1.35;font-weight:300}
.card-value{display:block;color:var(--text);font-size:31px;line-height:1;font-weight:400;letter-spacing:-.04em}
.card-foot{display:block;margin-top:10px;color:var(--muted-2);font-size:13px;line-height:1.35;font-weight:300}
.card-icon{
  width:42px;height:42px;min-width:42px;border-radius:10px;background:#edf2fb;display:inline-flex;align-items:center;justify-content:center;color:var(--blue);font-size:15px;font-weight:400;
}

.dashboard-grid{
  display:grid;
  grid-template-columns:minmax(0,1.55fr) minmax(340px,.85fr);
  gap:16px;
  align-items:start;
}
.stack{display:grid;gap:16px}
.panel{overflow:hidden}
.panel-head{
  min-height:60px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:18px 20px 0;
}
.panel-head h3{
  margin:0;
  color:var(--text);
  font-size:16px;
  line-height:1.2;
  font-weight:400;
  letter-spacing:-.02em;
}
.panel-head p{
  margin:4px 0 0;
  color:var(--muted);
  font-size:13px;
  line-height:1.4;
  font-weight:300;
}
.panel-link{
  margin-top:1px;
  color:var(--blue);
  font-size:13px;
  font-weight:300;
}
.panel-body{padding:18px 20px 20px}

.feature-list{display:grid;gap:12px}
.feature-item{
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:12px 0;
  border-bottom:1px solid var(--line);
}
.feature-item:last-child{padding-bottom:0;border-bottom:0}
.feature-bullet{
  width:26px;height:26px;min-width:26px;border-radius:999px;background:#edf2fb;color:var(--blue);display:inline-flex;align-items:center;justify-content:center;font-size:13px;font-weight:400;
}
.feature-item strong{display:block;color:var(--text);font-size:14px;line-height:1.2;font-weight:400}
.feature-item span{display:block;margin-top:4px;color:var(--muted);font-size:13px;line-height:1.45}

.module-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.module-box{
  min-height:72px;
  border:1px solid var(--line);
  background:var(--soft);
  border-radius:10px;
  padding:14px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.module-box strong{display:block;color:var(--text);font-size:14px;line-height:1.2;font-weight:400}
.module-box span{display:block;margin-top:4px;color:var(--muted);font-size:12px;line-height:1.35}

.activity-list{display:grid;gap:0}
.activity-item{
  display:grid;
  grid-template-columns:88px minmax(0,1fr);
  gap:12px;
  padding:12px 0;
  border-bottom:1px solid var(--line);
}
.activity-item:last-child{border-bottom:0;padding-bottom:0}
.activity-item strong{color:var(--text);font-size:14px;font-weight:400;line-height:1.25}
.activity-item span,.activity-time{color:var(--muted);font-size:13px;line-height:1.45}
.activity-time{font-weight:300}

.empty-state{
  min-height:250px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:26px;
  background:linear-gradient(180deg,#fff 0%,#fbfbf8 100%);
}
.empty-state strong{display:block;color:var(--text);font-size:18px;line-height:1.15;font-weight:400}
.empty-state p{margin:8px 0 0;color:var(--muted);font-size:14px;line-height:1.55;max-width:420px}

.footer-note{
  margin-top:16px;
  color:var(--muted-2);
  font-size:12px;
  line-height:1.55;
}

@media (max-width:1200px){
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dashboard-grid{grid-template-columns:1fr}
}

@media (max-width:980px){
  .app-sidebar{
    transform:translateX(-100%);
    transition:transform .28s ease;
    width:min(86vw,320px);
  }
  .menu-open .app-sidebar{transform:translateX(0)}
  .sidebar-close,.menu-toggle{display:inline-flex;align-items:center;justify-content:center}
  .main{margin-left:0;width:100%}
  .topbar{padding:0 16px}
  .top-copy h1{font-size:20px}
  .app-content{padding:16px}
  .hero-card{padding:18px;flex-direction:column;align-items:flex-start}
}

@media (max-width:720px){
  .stats-grid{grid-template-columns:1fr}
  .module-grid{grid-template-columns:1fr}
  .topbar{height:auto;min-height:80px;padding-top:12px;padding-bottom:12px;align-items:flex-start;gap:12px;flex-direction:column}
  .top-actions{width:100%;justify-content:flex-start;flex-wrap:wrap}
  .user-menu{width:100%}
 .user-trigger{width:100%;justify-content:flex-start}
  .user-meta{flex:1}
  .user-dropdown{left:0;right:auto;width:min(100%,280px)}
}

@media (max-width:560px){
  .brand-copy strong{font-size:14px}
  .brand-copy span{font-size:10px}
  .card{padding:18px}
  .panel-head,.panel-body{padding-left:16px;padding-right:16px}
  .activity-item{grid-template-columns:1fr}
  .activity-time{font-size:12px}
  .hero-copy h2{font-size:20px}
}
