/* layout/layout.css */
/* Grid shell: sidebar (desktop) + header + main content + mobile bottom nav */

:root{
  --sidebar-w: 260px;
  --shell-gap: 18px;

  /* use your existing vars if already defined elsewhere */
  --bg: #F8F3EA;
  --card: #ffffff;
  --text: #111;
  --muted: rgba(0,0,0,0.55);
  --border: rgba(0,0,0,0.08);
}

/* Base page background */
body{
  background: var(--bg);
}

/* Desktop shell */
.app-shell{
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* Sidebar container (slot) */
#sidebar-slot{
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: var(--card);
  border-right: 1px solid var(--border);
}

/* Main column */
.app-main{
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Header container (slot) */
#header-slot{
  position: sticky;
  top: 0;
  z-index: 20;
  background: white;
  border-bottom: 1px solid var(--border);
}

/* Main content area */
.page-content{
  padding: 18px;
}

/* ---------- Sidebar UI ---------- */
.sidebar{
  padding: 18px 14px;
}

.sidebar-title{
  font-size: 25px;
  font-weight: 700;
  margin-bottom: 54px;
}

.sidebar-nav{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 18px;
}

.nav-item:hover{
  background: rgba(32, 78, 207, 0.08);
}

.nav-item.active{
  background: rgba(32, 78, 207, 0.14);
  color: #204ECF;
}

/* ---------- Header UI ---------- */
.topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  gap: 14px;
}

.topbar-brand{
  font-size: 25px;
  font-weight: 800;
  color: #204ECF;
}

.topbar-right{
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  position: relative;
}

.icon-btn .dot{
  position: absolute;
  top: 8px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ff3b30;
}

.profile-chip{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
}

.profile-avatar{
  width: 34px;
  height: 34px;
  border-radius: 30px;
  background: rgba(32, 78, 207, 0.12);
  color: #204ECF;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.profile-meta{
  line-height: 1.1;
}

.profile-name{
  font-weight: 800;
  font-size: 13px;
}

.profile-sub{
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Bottom nav (mobile) ---------- */
#bottomnav-slot{
  display: none;
}

.bottom-nav{
  display: flex;
  justify-content: space-around;
  gap: 8px;
  padding: 10px 12px;
  background: var(--card);
  border-top: 1px solid var(--border);
}

.bn-item{
  flex: 1;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 12px;
}

.bn-item.active{
  color: #204ECF;
  background: rgba(32, 78, 207, 0.10);
}

.bn-icon{
  font-size: 16px;
}

/* Mobile behavior */
@media (max-width: 768px){
  .app-shell{
    grid-template-columns: 1fr;
  }

  #sidebar-slot{
    display: none;
  }

  #bottomnav-slot{
    display: block;
    position: sticky;
    bottom: 0;
    z-index: 30;
  }

  .page-content{
    padding-bottom: 88px; /* space for bottom nav */
  }
}
