/* =========================================================================
   Koyne — layout.css
   The app shell — sidebar + main area used by every authenticated screen.
   ========================================================================= */

.k-shell { display: flex; min-height: 100vh; align-items: stretch; }
.k-main  { flex: 1; padding: 28px 36px 60px; min-width: 0; max-width: 100%; }

.k-sidebar {
  width: 240px; flex-shrink: 0;
  padding: 28px 18px 22px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex; flex-direction: column;
}
[data-theme="dark"] .k-sidebar {
  background: var(--koyne-dark-bg);
  border-right-color: var(--koyne-dark-border);
}
.k-sidebar__brand { padding: 0 8px 28px; }
.k-sidebar__nav { display: flex; flex-direction: column; gap: 2px; }
.k-sidebar__item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--fg-2);
  text-decoration: none;
  transition: all var(--dur-base) var(--ease-out);
}
.k-sidebar__item:hover { background: var(--surface-2); color: var(--fg); }
.k-sidebar__item--active {
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
}
[data-theme="dark"] .k-sidebar__item { color: var(--koyne-dark-muted); }
[data-theme="dark"] .k-sidebar__item:hover { color: #F4F2FF; background: rgba(139,92,246,0.10); }
[data-theme="dark"] .k-sidebar__item--active {
  background: rgba(139,92,246,0.18); color: var(--koyne-lavender-300);
}
.k-sidebar__bottom { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.k-sidebar__user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px; border-radius: 10px;
}
.k-sidebar__avatar {
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.k-sidebar__user-name { font-size: 13px; font-weight: 600; color: var(--fg); }
.k-sidebar__user-sub  { font-size: 11px; color: var(--fg-3); }
.k-sidebar__divider {
  border-top: 1px solid var(--divider);
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px; font-size: 13px; color: var(--fg-2);
}
[data-theme="dark"] .k-sidebar__divider { border-top-color: var(--koyne-dark-border); }
.k-sidebar__theme-toggle {
  background: none; border: 0; padding: 0; cursor: pointer;
  width: 36px; height: 20px; border-radius: 999px;
  background: #CBD5E1; position: relative;
  transition: background var(--dur-base) var(--ease-out);
}
.k-sidebar__theme-toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 999px;
  background: #FFF; transition: left var(--dur-base) var(--ease-out);
}
[data-theme="dark"] .k-sidebar__theme-toggle { background: var(--accent); }
[data-theme="dark"] .k-sidebar__theme-toggle::after { left: 18px; }

@media (max-width: 1100px) {
  .k-sidebar { display: none; }
  .k-main { padding: 20px; }
}
