/* Authenticated shell only. Shared palette/header/footer remain in home.css. */
body.authenticated-layout { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg-light); --auth-header-height: 92px; }
.authenticated-layout .site-header { position: sticky; top: 0; z-index: 30; }
.authenticated-layout .header-inner { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 24px; }
.authenticated-layout .site-nav { flex: 1; }
.authenticated-layout .header-actions { max-width: 35%; }
.authenticated-layout .user-menu { max-width: 100%; min-width: 0; }
.authenticated-layout .user-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.authenticated-layout .user-menu-content { left: auto; right: 0; max-width: calc(100vw - 32px); }
.auth-layout { flex: 1; display: grid; grid-template-columns: 240px minmax(0, 1fr); align-items: start; gap: 24px; width: 100%; max-width: 1200px; margin: 0 auto; padding: 32px 20px; }
.sidebar { position: sticky; top: calc(var(--auth-header-height) + 16px); background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: 0 4px 16px rgba(15,23,42,.06); max-height: calc(100dvh - var(--auth-header-height) - 32px); overflow-y: auto; }
.sidebar-category { background: #f1f5f9; color: var(--text-muted); font-size: 14px; font-weight: 700; padding: 10px 14px; border-radius: 8px; }
.sidebar a { display: block; margin-top: 8px; padding: 10px 14px; background: transparent; border-radius: 8px; color: var(--text); font-size: 14px; font-weight: 400; text-decoration: none; overflow-wrap: anywhere; }
.sidebar a:hover { color: var(--accent); background: #f8fafc; }
.sidebar a:focus-visible, .sidebar-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sidebar-toggle, .sidebar-overlay { display: none; }
.auth-main { min-width: 0; }
.auth-main h1, .auth-main h2, .auth-main h3 { letter-spacing: normal; line-height: 1.3; }
.auth-main h1 { font-size: 30px; font-weight: 800; }
.auth-main h2 { font-size: 20px; }
.auth-main section { padding-block: 0; }
.auth-main .panel, .auth-main .card { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 16px; padding: 28px; box-shadow: 0 10px 30px rgba(0,0,0,.08); }
.authenticated-layout .site-footer p { margin: 0; color: var(--text-inverse); }
@media (max-width: 768px) {
  .authenticated-layout .header-inner { flex-wrap: wrap; gap: 12px; padding-block: 16px; }
  .authenticated-layout .brand { flex: 1; min-width: 0; }
  .authenticated-layout .brand-tagline { max-width: 130px; }
  .authenticated-layout .header-actions { max-width: 48%; gap: 8px; }
  .authenticated-layout .user-menu summary { gap: 6px; }
  .authenticated-layout .site-nav { order: 3; flex: 0 0 100%; justify-content: center; gap: 24px; }
  .sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 22px; cursor: pointer; }
  .auth-layout { grid-template-columns: minmax(0, 1fr); padding: 20px 16px; }
  .sidebar { position: fixed; top: var(--auth-header-height); bottom: 0; left: 0; width: min(280px, calc(100vw - 48px)); max-height: none; border-radius: 0 16px 16px 0; z-index: 25; transform: translateX(-100%); transition: transform .3s ease; visibility: hidden; }
  .sidebar.open { transform: translateX(0); visibility: visible; }
  .sidebar-overlay.open { display: block; position: fixed; inset: var(--auth-header-height) 0 0; z-index: 24; background: rgba(15,23,42,.45); }
  body.authenticated-layout.sidebar-open { overflow: hidden; }
  .auth-main .panel, .auth-main .card { padding: 22px; }
  .authenticated-layout .footer-links { flex-wrap: wrap; gap: 16px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

.sidebar a.active { background: #f1f5f9; color: var(--accent); font-weight: 700; }

/* Standalone cabinet entry, outside financial tools. */
.sidebar a.sidebar-dashboard {
  margin: 0 0 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
  color: var(--primary);
}
.sidebar a.sidebar-dashboard:hover { background: #f1f5f9; }
.sidebar a.sidebar-dashboard.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.sidebar a.sidebar-admin { margin-top: 16px; background: #f1f5f9; font-weight: 700; }

.sidebar-category { background: transparent; color: #7b8798; font-size: 11px; font-weight: 600; padding: 18px 10px 4px; letter-spacing: .035em; }
.sidebar-category:first-child { padding-top: 2px; }
.sidebar .sidebar-dashboard { margin-bottom: 0; }
.timezone-settings { max-width: 650px; }
.timezone-settings label { display: block; font-weight: 600; margin: 24px 0 8px; }
.timezone-settings select { width: 100%; padding: 13px; border: 1px solid var(--border); border-radius: 8px; background: white; font: inherit; }
.timezone-settings button { margin-top: 24px; }
.timezone-settings .hint { color: var(--text-muted); line-height: 1.7; }

/* The responsive drawer contains independent, identically styled cards. */
.assets-panel.right-sidebar {
  display: flex; flex-direction: column; gap: 20px; padding: 0;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
.right-sidebar .right-sidebar-card {
  box-sizing: border-box; width: 100%; margin: 0; padding: 20px 12px;
  border: 1px solid #e2e8f0; border-radius: 12px;
  background: #fff; box-shadow: 0 6px 24px rgb(15 23 42 / 7%);
}
@media (max-width: 768px) {
  .assets-panel.right-sidebar { padding: 0 0 16px; }
}

/* Keep all cabinet header controls inside narrow mobile viewports. */
@media (max-width: 400px) {
  .authenticated-layout .header-actions { max-width: none; flex: 0 0 auto; gap: 6px; }
  .authenticated-layout .header-actions .user-name { display: none; }
  .authenticated-layout .header-actions .user-menu summary { gap: 0; }
}
