/* TigoMeNote · shell.css — layout ng app pages (sidebar, topbar, hamburger drawer, bottom tabs)
   Desktop (>= 900px): isang full screen, walang whole-page scroll; ang content box lang ang nag-i-scroll.
   Phone (< 900px): normal na scroll, may topbar sa taas at tabs sa baba. */

.shell { min-height: 100vh; min-height: 100dvh; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -0.03em; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; background: #141418 url(../img/favicon.svg) center / cover no-repeat; color: transparent;
  display: grid; place-items: center; font-size: 0; position: relative; flex: none;
}
/* logo A (tools/brand/logo.py): ang "T" ay nakatago na; ang larawan na ang logo */
.brand b { color: var(--accent); font-weight: 800; }

/* ---------- Nav links (sidebar + drawer) ---------- */
.nav-list { display: grid; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: var(--r-md);
  color: var(--text-2); font-weight: 500; font-size: 14.5px; transition: background-color .15s, color .15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--surface-2); color: var(--text); font-weight: 650; }
.nav-link.active .ic { stroke-width: 2.2; }
.nav-link .nav-label { flex: 1; }
.nav-section { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 18px 12px 6px; }

.user-card {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface);
}
.user-card .who { flex: 1; min-width: 0; }
.user-card .who b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .who span { display: block; font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Sidebar (desktop) ---------- */
.sidebar { display: none; }

/* ---------- Topbar (phone) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 6px; padding: 0 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-link { position: relative; }
.topbar-link .dot-count { position: absolute; top: 3px; right: 1px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
.topbar-link.active { color: var(--accent); }
.topbar-title { flex: 1; font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; padding-left: 4px; }

/* ---------- Bottom tabs (phone) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: center;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
}
.tab {
  display: grid; justify-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--text-3);
  position: relative; padding: 6px 0;
}
.tab .ic { width: 23px; height: 23px; }
.tab.active { color: var(--text); }
.tab.active .ic { stroke-width: 2.2; }
.tab .dot-count { position: absolute; top: 2px; left: calc(50% + 6px); }
.tab-primary .tab-fab {
  width: 46px; height: 46px; border-radius: 16px; background: var(--ink); color: var(--ink-text);
  display: grid; place-items: center; box-shadow: var(--shadow-md); transition: transform .15s var(--ease);
}
.tab-primary:active .tab-fab { transform: scale(.94); }
.tab-primary .tab-label { display: none; }

/* ---------- Drawer (hamburger, phone) ---------- */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.35);
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease);
}
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 41; width: min(300px, 84vw);
  background: var(--bg); border-right: 1px solid var(--line); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 6px; padding: 14px 12px calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-102%); transition: transform .28s var(--ease); overflow-y: auto;
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; }
.drawer-foot { margin-top: auto; display: grid; gap: 10px; padding-top: 14px; }
body.drawer-open { overflow: hidden; }
body.drawer-open .drawer { transform: none; }
body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }

/* ---------- Main content ---------- */
.shell-main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
.page { max-width: var(--content-max); margin: 0 auto; padding: 20px 16px 32px; }
.page.wide { max-width: 1080px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head .eyebrow { font-size: 12.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.page-head .lead { color: var(--text-2); margin-top: 6px; }
.stack { display: grid; gap: 16px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.layout > * { min-width: 0; } /* para hindi lumapad ang page sa phone dahil sa mahabang laman (hal. albums) */
.layout-aside { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }

/* ================= Desktop ================= */
@media (min-width: 900px) {
  .shell {
    height: 100vh; height: 100dvh; overflow: hidden;
    display: grid; grid-template-columns: var(--sidebar-w) 1fr;
  }
  .topbar, .tabbar, .drawer, .drawer-backdrop { display: none; }

  .sidebar {
    display: flex; flex-direction: column; gap: 4px; height: 100%; overflow-y: auto;
    padding: 20px 14px; border-right: 1px solid var(--line); background: var(--bg);
  }
  .sidebar .brand { padding: 4px 8px 18px; }
  .sidebar-cta { margin: 8px 0 4px; }
  .sidebar-foot { margin-top: auto; display: grid; gap: 10px; padding-top: 16px; }

  .shell-main { height: 100%; overflow-y: auto; padding-bottom: 0; background: var(--bg); scrollbar-gutter: stable; }
  /* Full UI sa desktop/laptop: buong lapad ang gamit (rule ni Bench) */
  .page, .page.wide { max-width: 1480px; padding: 32px 40px 48px; }

  /* 2 columns: main + side panel (aside sa kanan). .layout.aside-left = aside sa kaliwa */
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
  .layout.aside-left { grid-template-columns: 360px minmax(0, 1fr); }
  .layout-aside { position: sticky; top: 0; display: grid; gap: 16px; }

  /* Pages na buong taas ang gamit (hal. Messages): .page.fill */
  .shell-main:has(.page.fill) { overflow: hidden; }
  .page.fill { height: 100%; display: flex; flex-direction: column; padding-bottom: 24px; }
}

/* Malapad na screen: mas malaking side panel */
@media (min-width: 1500px) {
  .layout { grid-template-columns: minmax(0, 1fr) 380px; }
}

/* ---------- RTL (Arabic) ---------- */
[dir="rtl"] .drawer { left: auto; right: 0; border-right: 0; border-left: 1px solid var(--line); transform: translateX(102%); }
[dir="rtl"] body.drawer-open .drawer { transform: none; }
[dir="rtl"] .topbar-title { padding-left: 0; padding-right: 4px; }
[dir="rtl"] .tab .dot-count { left: auto; right: calc(50% + 6px); }
[dir="rtl"] .brand-mark::after { right: auto; left: -2px; }
@media (min-width: 900px) { [dir="rtl"] .sidebar { border-right: 0; border-left: 1px solid var(--line); } }
