/* Shared layout: sidebar, header, bottom nav, drawer, flash */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Inter", Roboto, sans-serif;
  font-weight: 300; color: #1a1d24; background: #f5f7fb; line-height: 1.5;
  -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden;
  --bottom-nav-space: calc(100px + env(safe-area-inset-bottom, 0px));
  padding-bottom: var(--bottom-nav-space);
}
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font: inherit; border: none; outline: none; background: transparent; color: inherit; }
ul { list-style: none; }
body::before {
  content: ""; position: fixed; inset: 0;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(120,160,255,.28), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(255,150,200,.20), transparent 55%),
    radial-gradient(700px 500px at 50% 110%, rgba(120,255,220,.18), transparent 60%);
  z-index: -1; pointer-events: none;
}
.glass { background: rgba(255,255,255,.55); backdrop-filter: blur(22px) saturate(180%); -webkit-backdrop-filter: blur(22px) saturate(180%); border: 1px solid rgba(255,255,255,.6); box-shadow: 0 8px 30px rgba(20,30,60,.06); }
.app { min-height: 100vh; }
.sidebar { display: none; }
.main { min-width: 0; }
.header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(245,247,251,.72); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,.6); padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top));
}
.header-row { display: flex; align-items: center; gap: 10px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 17px; letter-spacing: -.02em; }
.logo-mark { width: 30px; height: 30px; border-radius: 10px; background: linear-gradient(135deg,#7aa2ff,#c58bff 60%,#ff9ec4); display: grid; place-items: center; box-shadow: 0 4px 14px rgba(140,120,255,.35); color: #fff; overflow: hidden; }
.logo-mark.has-img { background: #fff; padding: 0; }
.logo-mark.has-img img { width: 100%; height: 100%; object-fit: cover; }
.logo-mark svg { width: 16px; height: 16px; }
.header-title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.header-title h1 { font-size: 17px; font-weight: 500; letter-spacing: -.02em; line-height: 1.2; }
.header-title p { font-size: 11.5px; color: #7a8294; font-weight: 300; }
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.search { flex: 1; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; background: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.8); backdrop-filter: blur(14px); color: #6b7280; font-size: 14px; }
.search svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; }
.search input { width: 100%; }
.icon-btn { width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; background: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.8); transition: .2s; position: relative; flex-shrink: 0; }
.icon-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(120,140,255,.14); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot, .icon-btn .count { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: #ff5d8f; border: 1.5px solid #fff; }
.mobile-only { display: flex; }
.flash { margin-top: 10px; padding: 10px 14px; border-radius: 12px; font-size: 13px; }
.flash-success { background: rgba(16,185,129,.12); color: #059669; border: 1px solid rgba(16,185,129,.25); }
.flash-error { background: rgba(255,93,143,.12); color: #c81e5c; border: 1px solid rgba(255,93,143,.25); }
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  display: flex; align-items: center; justify-content: space-around;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(252,253,255,.82); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid rgba(255,255,255,.9); box-shadow: 0 -8px 30px rgba(20,30,60,.08);
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; color: #97a0b0; padding: 6px 10px; position: relative; transition: .2s; }
.nav-item svg { width: 20px; height: 20px; }
.nav-item.active { color: #1a1d24; font-weight: 500; }
.nav-item.active::before { content: ""; position: absolute; top: 0; width: 20px; height: 2px; border-radius: 2px; background: linear-gradient(90deg,#7aa2ff,#c58bff); }
.nav-item .dot { position: absolute; top: 4px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: #ff5d8f; border: 1.5px solid #fff; }
.fab { width: 52px; height: 52px; border-radius: 18px; background: linear-gradient(135deg,#1a1d24,#333846); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 28px rgba(26,29,36,.35); margin-top: -18px; transition: .22s; }
.fab:hover { transform: translateY(-2px); }
.fab svg { width: 22px; height: 22px; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(10,15,30,.28); backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: .3s; z-index: 90; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; max-height: 82vh; border-radius: 26px 26px 0 0; padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); background: rgba(252,253,255,.86); backdrop-filter: blur(30px); border-top: 1px solid rgba(255,255,255,.9); transform: translateY(105%); transition: transform .38s cubic-bezier(.2,.8,.2,1); overflow-y: auto; pointer-events: none; }
.drawer.open { transform: translateY(0); pointer-events: auto; }
.drawer-handle { width: 38px; height: 4px; border-radius: 3px; background: #d5dae5; margin: 6px auto 14px; }
.drawer-user { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: rgba(255,255,255,.6); border: 1px solid rgba(255,255,255,.9); margin-bottom: 16px; }
.drawer-avatar { width: 46px; height: 46px; border-radius: 15px; background: linear-gradient(135deg,#7aa2ff,#c58bff); display: grid; place-items: center; color: #fff; font-weight: 500; font-size: 17px; }
.user-avatar { display: grid; place-items: center; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg,#7aa2ff,#c58bff); color: #fff; font-weight: 500; flex-shrink: 0; }
.user-avatar.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-avatar.side-user-avatar,
.user-avatar.drawer-avatar { border-radius: 12px; }
.user-avatar.drawer-avatar { border-radius: 15px; }
.avatar-img,
.card-avatar-v2 img,
.master-avatar img,
.ao-master-avatar img,
.greeting-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.ad-banner .ad-thumb { width: 56px; height: 56px; border-radius: 14px; overflow: hidden; flex-shrink: 0; position: relative; z-index: 1; }
.ad-banner .ad-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
a.ad-banner { text-decoration: none; color: inherit; cursor: pointer; }
a.ad-banner:hover { text-decoration: none; }
.slide.has-image .slide-bg::before {
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.55) 100%);
}
.drawer-user h4 { font-size: 14px; font-weight: 500; }
.drawer-user p { font-size: 12px; color: #7a8294; }
.drawer-nav { display: flex; flex-direction: column; gap: 2px; }
.drawer-link { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 14px; font-size: 14px; transition: .18s; }
.drawer-link:hover { background: rgba(122,162,255,.09); }
.drawer-link svg { width: 19px; height: 19px; color: #5a6478; }
.drawer-link .chev { margin-left: auto; color: #b8bec9; width: 14px !important; height: 14px !important; }
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 999px; background: linear-gradient(135deg,#1a1d24,#333846); color: #fff; font-weight: 500; font-size: 14px; transition: .22s; border: none; cursor: pointer; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(26,29,36,.25); }
.btn-secondary { display: inline-flex; align-items: center; justify-content: center; padding: 12px 20px; border-radius: 999px; background: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.9); font-weight: 500; font-size: 14px; }
.empty-state { text-align: center; padding: 40px 20px; color: #7a8294; }
.empty-state h3 { font-size: 16px; font-weight: 500; color: #1a1d24; margin-bottom: 8px; }
@media (min-width: 768px) {
  body {
    --bottom-nav-space: env(safe-area-inset-bottom, 0px);
    padding-bottom: var(--bottom-nav-space);
  }
  .bottom-nav { display: none; }
  .header { padding: 12px 24px; }
}
@media (min-width: 1100px) {
  .app { display: grid; grid-template-columns: 250px 1fr; max-width: 1440px; margin: 0 auto; }
  .sidebar { display: flex; flex-direction: column; gap: 4px; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid rgba(255,255,255,.7); background: rgba(255,255,255,.35); backdrop-filter: blur(24px); }
  .sidebar .logo { padding: 6px 10px 18px; font-size: 18px; }
  .side-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: rgba(255,255,255,.6); border: 1px solid rgba(255,255,255,.85); margin-bottom: 14px; }
  .side-user-avatar { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg,#7aa2ff,#c58bff); display: grid; place-items: center; color: #fff; font-weight: 500; font-size: 14px; }
  .side-user-info h4 { font-size: 12.5px; font-weight: 500; }
  .side-user-info p { font-size: 11px; color: #7a8294; }
  .side-link { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; font-size: 13.5px; color: #404652; transition: .18s; }
  .side-link:hover { background: rgba(122,162,255,.09); color: #1a1d24; }
  .side-link.active { background: linear-gradient(135deg, rgba(122,162,255,.18), rgba(197,139,255,.18)); color: #1a1d24; font-weight: 500; }
  .side-link svg { width: 18px; height: 18px; }
  .side-link .tag { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: rgba(122,162,255,.22); font-size: 10px; font-weight: 500; color: #4a5a8a; }
  .side-link .tag.red { background: rgba(255,93,143,.16); color: #c81e5c; }
  .side-sep { height: 1px; background: rgba(0,0,0,.05); margin: 10px 8px; }
  .side-promo { margin-top: auto; padding: 14px; border-radius: 16px; background: linear-gradient(140deg, rgba(122,162,255,.2), rgba(255,158,196,.2)); border: 1px solid rgba(255,255,255,.85); font-size: 12px; color: #4a5162; }
  .side-promo strong { display: block; font-weight: 500; font-size: 13px; color: #1a1d24; margin-bottom: 3px; }
  .side-promo button { width: 100%; margin-top: 8px; padding: 8px 12px; border-radius: 999px; background: #1a1d24; color: #fff; font-size: 11.5px; font-weight: 500; }
  .mobile-only { display: none !important; }
}
