/* ============================================================
   Kafanet Web — Layout (Header, Footer, Container, Mobile menu)
   ============================================================ */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}
@media (min-width: 768px) { .container { padding: 0 32px; } }

/* ── App Header ─────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 251, 246, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.app-header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
}
.brand-text {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.8px;
}

/* Top nav (desktop) */
.app-nav {
  display: none;
  gap: 4px;
  align-items: center;
}
.app-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.app-nav a:hover { background: var(--bg-alt); color: var(--ink); text-decoration: none; }
.app-nav a.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}
.app-nav a.is-active:hover { background: var(--accent-soft); color: var(--accent); }

.app-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  position: relative;
  text-decoration: none;
  color: var(--ink);
}
.app-icon-btn:hover { background: var(--bg-alt); text-decoration: none; }
.app-icon-btn .dot {
  position: absolute;
  top: 8px; right: 9px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--card);
}

.menu-toggle {
  display: inline-flex;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  align-items: center; justify-content: center;
  cursor: pointer;
}
.menu-toggle svg { width: 20px; height: 20px; }

@media (min-width: 900px) {
  .app-nav { display: flex; }
  .menu-toggle { display: none; }
}

/* Mobile drawer */
.app-drawer {
  position: fixed;
  inset: 0;
  background: rgba(26,22,20,0.5);
  z-index: 200;
  display: flex;
  justify-content: flex-end;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s, visibility 0.2s;
}
.app-drawer.open { visibility: visible; opacity: 1; }
.app-drawer-inner {
  width: 320px;
  max-width: 90%;
  background: var(--bg);
  height: 100%;
  padding: 24px 20px;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
}
.app-drawer.open .app-drawer-inner { transform: translateX(0); }
.app-drawer-close {
  width: 36px; height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 20px;
  margin-bottom: 16px;
}
.app-drawer a {
  display: block;
  padding: 14px 12px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.app-drawer a:hover { background: var(--bg-alt); }
.app-drawer a.is-active { background: var(--accent-soft); color: var(--accent); }

/* ── Footer ─────────────────────────────────────────────── */
.app-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.7);
  padding: 48px 0 32px;
  margin-top: 60px;
}
.app-footer .container {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 32px;
}
@media (max-width: 800px) {
  .app-footer .container { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
  .app-footer .container { grid-template-columns: 1fr; }
}
.app-footer h4 { color: #fff; margin-bottom: 12px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px; }
.app-footer a { color: rgba(255,255,255,0.7); display: block; padding: 4px 0; text-decoration: none; font-size: 13px; }
.app-footer a:hover { color: #fff; text-decoration: none; }
.app-footer .brand-text { color: #fff; }
.app-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 32px;
  padding-top: 20px;
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}

/* ── Main page wrappers ─────────────────────────────────── */
.page { padding: 24px 0 60px; }
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.page-header-text h1 { margin: 0; }
.page-header-text p { color: var(--ink-soft); margin-top: 4px; font-size: 14px; }
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Hero (landing) ─────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 80px 0;
}
.hero h1 {
  font-size: clamp(36px, 8vw, 64px);
  letter-spacing: -2px;
  margin-bottom: 16px;
  font-weight: 700;
}
.hero p {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.55;
}
.hero-actions {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Grid ───────────────────────────────────────────────── */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-2-1 { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── Auth pages ─────────────────────────────────────────── */
.auth-page {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}
.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xxl);
  padding: 40px 32px;
  box-shadow: var(--shadow-md);
}
.auth-logo { display: flex; justify-content: center; margin-bottom: 24px; }
.auth-card h1 { text-align: center; font-size: 28px; margin-bottom: 6px; }
.auth-card .subtitle { text-align: center; color: var(--ink-soft); margin-bottom: 28px; font-size: 15px; }
.auth-footer { text-align: center; margin-top: 16px; font-size: 14px; color: var(--ink-soft); }

/* ── Sticky footer-bar (solve, mobile actions) ──────────── */
.sticky-bar {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  z-index: 30;
  margin-top: 24px;
}

/* ── Tab bar (used on settings / progress) ──────────────── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.is-active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
