/* ============================================================
   Buttons
   ============================================================ */

.btn {
  border: 0;
  border-radius: 12px;
  min-height: 46px;
  padding: 11px 17px;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--green-900); color: white; box-shadow: 0 10px 22px rgba(18,94,61,.18); }
.btn-primary:hover { background: #0e4a30; }
.btn-secondary { background: var(--green-50); color: var(--green-900); border: 1px solid var(--green-100); }
.btn.compact { min-height: 38px; padding: 8px 13px; font-size: 13px; }
.btn-danger { background: var(--danger-soft); color: var(--danger); border: 1px solid #efc8c5; }
.btn:disabled { cursor: wait; opacity: .65; }

/* ============================================================
   Layout: App Shell, Sidebar, Topbar, Main Area
   ============================================================ */

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 270px minmax(0, 1fr); }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 270px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  color: #f5faf7;
  background:
    radial-gradient(circle at top right, rgba(198,155,75,.18), transparent 29%),
    var(--green-900);
}
.sidebar-header { padding: 24px 18px 23px; border-bottom: 1px solid rgba(255,255,255,.12); flex-shrink: 0; }
.sidebar-header-inner { display: flex; align-items: center; gap: 12px; }
.sidebar-header .icon-btn { margin-left: auto; background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.12); width: 34px; height: 34px; }
.sidebar-header strong { display: block; font-size: 16px; }
.sidebar-header span { display: block; margin-top: 2px; color: rgba(255,255,255,.6); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.mini-logo { width: 36px; height: 36px; border-radius: 10px; display: block; object-fit: cover; }
.side-nav { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.side-nav::-webkit-scrollbar { width: 4px; }
.side-nav::-webkit-scrollbar-track { background: transparent; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
.nav-item { width: 100%; border: 0; background: transparent; color: rgba(255,255,255,.72); border-radius: 8px; padding: 8px 10px; display: flex; align-items: center; gap: 8px; text-align: left; font-weight: 700; font-size: 13px; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { color: #fff; background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.nav-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.08); font-size: 11px; letter-spacing: .08em; }
.nav-item.active .nav-icon { background: var(--gold); color: #27382f; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.12);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sync-status { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.68); font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #e1ae45; box-shadow: 0 0 0 4px rgba(225,174,69,.13); }
.status-dot.online { background: #71c392; box-shadow: 0 0 0 4px rgba(113,195,146,.14); }
.sidebar-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.sidebar-tools .text-btn {
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 9px;
  background: rgba(255,255,255,.06);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.sidebar-tools .sync-btn { grid-column: 1 / -1; background: rgba(198,155,75,.18); border-color: rgba(198,155,75,.28); }
.text-btn { border: 0; background: none; color: #fff; font-weight: 700; font-size: 12px; }
.sidebar-tools .text-btn:hover { background: rgba(255,255,255,.11); }
.sidebar-tools .text-btn:disabled { opacity: .55; cursor: default; }

.main-area { grid-column: 2; min-width: 0; }
.topbar {
  height: 92px;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px clamp(20px, 4vw, 44px);
  padding-left: 60px;
  background: rgba(243,245,239,.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(215,224,216,.9);
}
.topbar h2 { margin: 0; font-size: 23px; letter-spacing: -.02em; }

/* Online/Offline indicator */
.online-indicator {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e1ae45;
  box-shadow: 0 0 0 3px rgba(225,174,69,.3);
  flex-shrink: 0;
}
.status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.3);
}
.status-dot.offline {
  background: #ca8a04;
  box-shadow: 0 0 0 3px rgba(202,138,4,.3);
}
.user-chip { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-chip strong, .user-chip span { display: block; max-width: 210px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip strong { font-size: 13px; }
.user-chip div > span { color: var(--muted); font-size: 11px; margin-top: 2px; }
.avatar { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }
.avatar.fallback { display: grid; place-items: center; background: var(--green-800); color: #fff; font-weight: 850; }
.icon-btn { width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: white; color: var(--ink); display: grid; place-items: center; font-size: 20px; }

.content-wrap { padding: 24px clamp(18px, 4vw, 44px) 60px; max-width: 1520px; margin: 0 auto; }
.notice { padding: 13px 16px; border: 1px solid #ead9b9; background: #fff9ec; color: #6d5425; border-radius: 13px; font-size: 13px; line-height: 1.55; margin-bottom: 20px; }
.page { display: none; }
.page.active-page { display: block; animation: rise .24s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.sidebar-overlay { display: none; }
.mobile-only { display: none; }
