/* ============================================
   Stethiano · Layout
   Header · Sidebar · Bottom nav · Footer
   ============================================ */

/* -------- Top header (marketing) -------- */
.site-header {
  position: sticky; top: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--color-border);
  z-index: var(--z-header);
  height: var(--header-h);
}
.site-header-inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-6);
}
.site-nav { display: flex; gap: var(--space-7); }
.site-nav a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-2);
}
.site-nav a:hover { color: var(--color-primary); }
.site-header-actions { display: flex; align-items: center; gap: var(--space-3); }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.125rem;
  color: var(--color-text);
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--color-primary);
  color: white;
  display: grid; place-items: center;
  position: relative;
  flex-shrink: 0;
}
.brand-mark svg { width: 18px; height: 18px; }

/* -------- App header (logged-in) -------- */
.app-header {
  position: sticky; top: 0;
  height: var(--header-h);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  z-index: var(--z-header);
  padding: 0 var(--space-6);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-5);
}
.app-header-search {
  flex: 1;
  max-width: 440px;
  position: relative;
}
.app-header-actions { display: flex; align-items: center; gap: var(--space-2); position: relative; }
.icon-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: grid; place-items: center;
  color: var(--color-muted);
  position: relative;
  transition: all var(--dur-fast) var(--ease-out);
}
.icon-btn:hover { background: var(--color-surface-2); color: var(--color-text); }
.icon-btn .badge-dot {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px;
  background: var(--color-danger);
  border-radius: 50%;
  border: 2px solid var(--color-surface);
}
.icon-btn .badge-count {
  position: absolute; top: 4px; right: 4px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: var(--color-danger);
  color: white;
  border-radius: 999px;
  font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid var(--color-surface);
}

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

.app-sidebar {
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: var(--space-5) var(--space-3);
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.sidebar-brand { padding: 6px 12px 24px; }
.sidebar-section {
  padding: var(--space-4) 12px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-muted-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-2);
  position: relative;
  transition: all var(--dur-fast) var(--ease-out);
}
.sidebar-link:hover { background: var(--color-surface-2); color: var(--color-text); }
.sidebar-link.active { background: var(--color-primary-tint); color: var(--color-primary); }
.sidebar-link.active .icon { color: var(--color-primary); }
.sidebar-link .icon { width: 18px; height: 18px; color: var(--color-muted); }
.sidebar-link .count {
  margin-left: auto;
  font-size: 11px; font-weight: 700;
  padding: 1px 8px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  border-radius: 999px;
}
.sidebar-foot {
  margin-top: auto;
  padding: var(--space-3);
  border-top: 1px solid var(--color-divider);
}
.sidebar-card {
  padding: var(--space-4);
  background: linear-gradient(135deg, #0F766E, #14B8A6);
  border-radius: var(--radius-md);
  color: white;
}
.sidebar-card h4 { color: white; font-size: var(--text-sm); margin-bottom: 4px; }
.sidebar-card p { color: rgba(255,255,255,0.85); font-size: var(--text-xs); margin-bottom: var(--space-3); }
.sidebar-card .btn { background: white; color: var(--color-primary); height: 32px; padding: 0 var(--space-4); font-size: var(--text-xs); }

/* -------- App content -------- */
.app-main {
  display: flex; flex-direction: column;
  min-width: 0;
}
.app-content {
  padding: var(--space-7) var(--space-7);
  flex: 1;
  max-width: 100%;
}
@media (max-width: 720px) {
  .app-content { padding: var(--space-5) var(--space-4) calc(var(--bottom-nav-h) + var(--space-5)); }
}

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-7);
  flex-wrap: wrap;
}
.page-head h1 {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
}
.page-head .subtitle {
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin-top: 6px;
}
.page-head-actions { display: flex; gap: var(--space-3); align-items: center; }

.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--color-muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--color-muted); }
.breadcrumb a:hover { color: var(--color-text); }
.breadcrumb .sep { color: var(--color-muted-2); }

/* -------- Mobile nav -------- */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  z-index: var(--z-header);
  padding: 6px;
}
.bottom-nav-list { display: grid; grid-template-columns: repeat(5, 1fr); width: 100%; gap: 2px; }
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  font-size: 10px; font-weight: 600;
  color: var(--color-muted);
  padding: 4px;
  border-radius: var(--radius-md);
  transition: color var(--dur-fast) var(--ease-out);
}
.bottom-nav-item .icon { width: 22px; height: 22px; }
.bottom-nav-item.active { color: var(--color-primary); }

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar { display: none; }
  .bottom-nav { display: flex; }
}

/* -------- Footer -------- */
.site-footer {
  background: #0B1220;
  color: #E5E7EB;
  padding: var(--space-10) 0 var(--space-7);
  margin-top: var(--space-12);
}
.site-footer h5 { color: white; font-size: var(--text-sm); margin-bottom: var(--space-4); }
.site-footer a { color: rgba(229, 231, 235, 0.7); font-size: var(--text-sm); display: block; padding: 4px 0; }
.site-footer a:hover { color: white; }
.site-footer .footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: var(--space-7); }
.site-footer .footer-meta { font-size: var(--text-xs); color: rgba(229, 231, 235, 0.5); margin-top: var(--space-4); }
.site-footer-bottom {
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: var(--space-4);
  font-size: var(--text-xs);
  color: rgba(229, 231, 235, 0.6);
}
@media (max-width: 960px) {
  .site-footer .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .site-footer .footer-grid { grid-template-columns: 1fr; }
}

/* -------- Mobile menu trigger -------- */
.menu-trigger {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  align-items: center; justify-content: center;
  color: var(--color-text);
}
@media (max-width: 960px) {
  .menu-trigger { display: inline-flex; }
  .site-nav { display: none; }
  .app-header-search { display: none; }
}

/* -------- Auth layout -------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-aside {
  background: linear-gradient(150deg, #0F766E 0%, #134E4A 60%, #064E3B 100%);
  color: white;
  padding: var(--space-9);
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-aside::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 110%, rgba(245, 158, 11, 0.18), transparent 50%),
    radial-gradient(circle at 100% 0%, rgba(20, 184, 166, 0.25), transparent 50%);
  pointer-events: none;
}
.auth-aside-content { position: relative; z-index: 1; }
.auth-aside h2 { color: white; font-size: var(--text-4xl); letter-spacing: -0.02em; font-weight: 700; line-height: 1.1; max-width: 460px; }
.auth-aside p { color: rgba(255,255,255,0.8); font-size: var(--text-base); max-width: 440px; margin-top: var(--space-4); line-height: var(--leading-relaxed); }
.auth-form-side {
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-9) var(--space-7);
  background: var(--color-surface);
}
.auth-form {
  width: 100%;
  max-width: 420px;
}
@media (max-width: 880px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}

/* -------- Two col layouts -------- */
.split {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-7);
  align-items: start;
}
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } }

.split-narrow {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-7);
}
@media (max-width: 880px) { .split-narrow { grid-template-columns: 1fr; } }
