/* Layout: the public site shell (sticky top bar + dark footer) and the app shell (floating sidebar panel + main),
   shared by the user dashboard and the admin panel. */

/* --- brand ------------------------------------------------------------------------------------------ */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text-strong); font: 800 21px/1 var(--font-display); letter-spacing: -.3px; }
.brand:hover { color: var(--text-strong); }
.logo-img { width: 36px; height: 36px; border-radius: 9px; }

/* --- public site --------------------------------------------------------------------------------------- */
.site-nav-wrap { position: sticky; top: 0; z-index: 20; background: rgb(246 247 245 / .94); border-bottom: 1px solid var(--line); }
[data-theme="dark"] .site-nav-wrap { background: rgb(14 19 18 / .94); }
.site-nav {
  max-width: 1200px; margin: 0 auto; min-height: 68px; padding: 0 20px;
  display: flex; align-items: center; gap: 28px;
}
.site-nav.glass { background: none; border: 0; box-shadow: none; }
.site-nav nav { display: flex; gap: 2px; font-size: 14.5px; font-weight: 500; }
.site-nav nav a { padding: 8px 12px; border-radius: var(--r-sm); color: var(--text-muted); }
.site-nav nav a:hover, .site-nav nav a[aria-current=page] { color: var(--text-strong); }
.site-nav nav a[aria-current=page] { font-weight: 700; }
.site-nav .actions { display: flex; gap: 8px; align-items: center; margin-inline-start: auto; }
.site-nav .login { min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; font-size: 14.5px; font-weight: 600; color: var(--text-strong); }
.site-main { padding: 40px 0 80px; }
.page-head { text-align: start; margin: 24px 0 36px; max-width: 760px; }
.page-head h1 { font-size: var(--fs-section); letter-spacing: -.6px; margin-bottom: 10px; }
.page-head p { color: var(--text-muted); font-size: 17px; }

/* --- footer --------------------------------------------------------------------------------------------- */
.site-footer { background: #0B1715; color: #A9B8B4; font-size: 14px; }
.site-footer .container { padding: 56px 0 28px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; }
.footer-grid p { margin: 12px 0 14px; line-height: 1.9; max-width: 36ch; }
.footer-title { color: #FFFFFF; font-weight: 800; }
.footer-links { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.site-footer a { color: #C9D4D1; }
.site-footer a:hover { color: #FFFFFF; }
.site-footer .brand { color: #FFFFFF; }
.site-footer .chip { background: transparent; border-color: #2E3E3A; color: #C9D4D1; }
/* social networks: each logo in its own colours on a white tile (static/img/social/<key>.svg) */
.socials { display: flex; flex-wrap: wrap; gap: 10px; }
.social { width: 42px; height: 42px; border-radius: var(--r-md); background: #FFFFFF; display: grid; place-items: center;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast); }
.social img { width: 22px; height: 22px; }
.social:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -8px rgb(0 0 0 / .6); }
.trust-badges { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.trust-badges img { max-height: 90px; width: auto; background: #FFF; border-radius: 10px; padding: 4px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 36px; padding-top: 20px; border-top: 1px solid #22322F; color: #8FA19D; }

/* --- app shell (dashboard + admin) ------------------------------------------------------------------------ */
.in-app { background: var(--ground); }
.app { display: flex; gap: 16px; min-height: 100vh; padding: 16px; max-width: 1520px; margin: 0 auto; }
.sidebar { width: 264px; flex-shrink: 0; position: sticky; top: 16px; height: calc(100vh - 32px); z-index: 30; }
.sidebar-inner {
  height: 100%; border-radius: var(--r-xl); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line);
}
.sidebar-inner > * { flex-shrink: 0; }  /* a short window scrolls the sidebar instead of crushing the token card */
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 8px 16px; }
.side-head .theme-toggle .btn { width: 36px; min-height: 36px; border-radius: var(--r-sm); }
.nav-group { font-size: 12px; font-weight: 700; color: var(--text-faint); padding: 10px 12px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: var(--r-md);
  font-size: 14.5px; font-weight: 600; color: var(--text-muted); transition: background-color var(--t-fast), color var(--t-fast);
}
.nav-item .icon { width: 19px; height: 19px; }
.nav-item:hover { background: var(--surface-2); color: var(--text-strong); }
.nav-item[aria-current=page] { color: var(--accent-mint); background: var(--accent-a10); }
.nav-count { margin-inline-start: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--r-pill); display: grid; place-items: center;
  font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text-muted); }
.nav-item[aria-current=page] .nav-count { background: var(--surface); }
.nav-count.alert { background: var(--danger-soft); color: var(--danger-text); }
.nav-sep { height: 1px; background: var(--line); margin: 10px 6px; }

.side-tokens {
  margin-top: auto; border-radius: var(--r-md); padding: 16px; position: relative;
  background: var(--spark-a10); border: 1px solid var(--spark-a30); display: grid; gap: 6px;
}
.side-tokens .label { font-size: 12.5px; font-weight: 700; color: var(--spark-soft); }
.side-tokens .value { font: 800 30px/1.15 var(--font-display); color: var(--text-strong); }
.side-tokens .value small { font: 600 13px var(--font); color: var(--text-muted); }
.side-tokens .note { font-size: 12.5px; color: var(--text-muted); }
.side-tokens .btn { width: 100%; margin-top: 4px; min-height: 40px; }

.side-user { display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; margin-top: 12px; border-top: 1px solid var(--line); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: var(--avatar-bg); font-size: 15px; font-weight: 800; color: var(--accent-mint);
}
.side-user .who { flex: 1; min-width: 0; }
.side-user .name { font-size: 14px; font-weight: 700; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .phone { font-size: 12px; color: var(--text-faint); white-space: nowrap; }

.app-main { flex: 1; min-width: 0; padding: 0 0 48px; }
.topline { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 4px 18px; }
.topline .date { font-size: 13.5px; color: var(--text-faint); }
.topline h1 { margin: 0; font-size: 26px; }
.topline .acts { display: flex; gap: 10px; flex-wrap: wrap; }
.search-box { height: 44px; width: 320px; max-width: 100%; border-radius: var(--r-md); display: flex; align-items: center; gap: 10px; padding: 0 12px; margin: 0;
  background: var(--surface); border: 1px solid var(--line); box-shadow: none; }
.search-box input { flex: 1; min-width: 0; min-height: 0; height: 100%; padding: 0; background: transparent; border: none; box-shadow: none; }
.search-box input:focus { box-shadow: none; }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-a16); }
.search-box .icon { width: 18px; height: 18px; color: var(--text-faint); }
.app-main > .flash:first-child { margin-top: 0; }

/* mobile: the sidebar becomes a drawer */
.drawer-backdrop { display: none; }
@media (max-width: 900px) {
  .site-nav { padding: 8px 16px; flex-wrap: wrap; gap: 8px 16px; }
  .site-nav nav { order: 3; width: 100%; overflow-x: auto; margin: 0 -8px; }
  .site-nav nav a { padding: 6px 10px; white-space: nowrap; }

  .app { display: block; padding: 10px; }
  .sidebar {
    position: fixed; inset: 0 0 0 auto; width: min(300px, 86vw); padding: 10px; height: 100vh; top: 0;
    transform: translateX(105%); transition: transform .25s var(--ease);
  }
  .sidebar.open { transform: none; }
  .drawer-backdrop.open { display: block; position: fixed; inset: 0; z-index: 25; background: rgb(11 23 21 / .45); }
  .app-main { padding: 0 0 40px; }
  .topline h1 { font-size: 22px; }
  .search-box { width: 100%; }
}
