/* DoubleCRM navigation and top bar. Page content keeps its own theme. */
:root {
  --shell-ink: #16374c;
  --shell-secondary: #536d80;
  --shell-line: #e3edf2;
  --shell-accent: #008fae;
}
.sidebar { min-height: 0; height: 100dvh; box-shadow: -4px 0 24px #16374c06; }
.sidebar-rail { flex-shrink: 0; padding: 24px 7px; gap: 13px; background: #132c40; border: 0; }
.sidebar-rail .rail-item { border-radius: 11px; color: #a9c0ce; transition: background .16s, color .16s; }
.sidebar-rail .rail-item:hover { color: #fff; background: #23455a; transform: none; box-shadow: none; }
.sidebar-rail .rail-item.active { color: #8fe9eb; background: #21485c; box-shadow: inset 0 0 0 1px #83dae92b; }
.sidebar-rail .rail-icon { display: grid; place-items: center; }
.sidebar-rail .hr-mark { font-size: 10px; font-weight: 800; letter-spacing: -.3px; }
.sidebar-divider { flex-shrink: 0; background: #dfeaf0; box-shadow: none; }
.sidebar-main { min-height: 0; height: 100%; padding-bottom: 0; background: #fff; border-left: 1px solid var(--shell-line); }
.sidebar-logo { flex-shrink: 0; display: flex; align-items: center; min-height: 100px; padding: 22px 18px 18px; margin: 0; border: 0; }
.sidebar-logo-home { border-radius: 8px; }
.sidebar-logo-home:hover { background: #f6fafc; transform: none; }
.sidebar-logo-home img { display: block; width: 100%; max-width: 204px; height: 52px; margin: 0 auto; object-fit: contain; }
.sidebar-context { flex-shrink: 0; margin: 0 20px 12px; padding: 16px 0 14px; border-top: 1px solid var(--shell-line); border-bottom: 1px solid var(--shell-line); }
.sidebar-context-kicker { color: #718896; font-size: 10px; font-weight: 600; margin-bottom: 6px; }
.sidebar-context-title { color: var(--shell-ink); font-size: 19px; font-weight: 800; line-height: 1.3; }
.sidebar-context-sub { color: var(--shell-secondary); font-size: 11px; line-height: 1.65; margin-top: 5px; }
.sidebar-main-nav { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 12px 12px; scrollbar-width: thin; scrollbar-color: #d6e4eb transparent; }
.sidebar .nav-section { padding: 0; margin: 0 0 13px; }
.sidebar .nav-section:last-child { margin-bottom: 0; }
.sidebar .nav-label { display: flex; align-items: center; gap: 10px; padding: 9px 12px 7px; color: #698393; font-size: 10px; font-weight: 700; }
.sidebar .nav-label::after { content: ''; height: 1px; background: #edf3f6; flex: 1; }
.sidebar .nav-item { min-height: 38px; margin: 2px 0; padding: 8px 12px; gap: 11px; border: 1px solid transparent; border-radius: 10px; color: #425f72; font-family: 'Assistant', sans-serif; font-size: 13px; font-weight: 600; line-height: 1.35; transition: background .16s, color .16s, border-color .16s; }
.sidebar .nav-item:hover { background: #f3f8fa; color: var(--shell-ink); transform: none; }
.sidebar .nav-item.active { background: #eaf8fb; color: #087f9c; border-color: #d8eff4; font-weight: 800; box-shadow: none; }
.sidebar .nav-item.active::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #00a5bd; margin-inline-start: auto; }
.sidebar .nav-item-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex: 0 0 18px; color: #78909e; }
.sidebar .nav-item-icon svg { width: 18px; height: 18px; }
.sidebar .nav-item.active .nav-item-icon { color: #008ea9; }
.sidebar .nav-item-label { min-width: 0; }
.sidebar .nav-item.is-placeholder { color: #7b8e9b; }
.sidebar .nav-item.featured-sun { color: #425f72; background: transparent; border-color: transparent; }
.sidebar .nav-item.featured-sun::before { display: none; }
.sidebar .nav-item.featured-sun .nav-item-icon { color: #ac823a; }
.sidebar .nav-item.featured-sun:hover { background: #fbf7ed; color: #7b622f; }
.sidebar .nav-item.featured-sun.active { background: #faf5e9; border-color: #efe4ca; color: #806127; box-shadow: none; }
.sidebar .nav-item.featured-sun.active::after { background: #b99244; }
.sidebar-bottom { flex-shrink: 0; margin: 0 20px; padding: 15px 0 18px; border-top: 1px solid var(--shell-line); }
.sidebar-mini-note { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: #718896; font-size: 10px; line-height: 1.5; }
.sidebar-footer-brand { color: #405e72; font-family: Arial, sans-serif; font-size: 11px; font-weight: 700; letter-spacing: -.3px; }
.topbar { min-height: 64px; height: 64px; padding: 0 28px; gap: 12px; background: #fff; border-color: var(--shell-line); box-shadow: 0 3px 16px #16374c03; }
.topbar-title { color: var(--shell-ink); font-size: 18px; font-weight: 800; }
.topbar-date { color: var(--shell-secondary); border: 0; background: transparent; padding: 6px 4px; font-size: 11px; gap: 8px; }
.shell-control-icon { display: inline-block; width: 16px; height: 16px; flex-shrink: 0; color: #5d8194; }
.topbar-actions-btn { height: 36px; padding: 0 13px; border: 1px solid #dcecf2; border-radius: 9px; color: #157b94; background: #f0f9fc; font-family: 'Assistant', sans-serif; font-size: 12px; }
.topbar-actions-btn .shell-control-icon { color: #098daa; }
.topbar-actions-btn:hover, .topbar-actions-wrap.open .topbar-actions-btn { border-color: #a6dbe7; background: #eaf7fb; color: #087c98; }
.topbar-user-btn { height: 40px; padding: 0 10px; gap: 9px; border: 1px solid #e4edf2; border-radius: 10px; background: #fff; color: var(--shell-ink); font-family: 'Assistant', sans-serif; }
.topbar-user-btn:hover, .topbar-user-wrap.open .topbar-user-btn { border-color: #bedde7; background: #f7fbfc; }
.topbar-user-avatar { width: 29px; height: 29px; border-radius: 9px; background: #173d53; font-size: 11px; }
.topbar-user-name { font-size: 12px; font-weight: 700; }
.topbar-user-role { margin-top: 2px; color: #617b8c; font-size: 10px; }
.topbar-actions-menu, .topbar-user-menu { top: calc(100% + 10px); border: 1px solid var(--shell-line); border-radius: 13px; box-shadow: 0 12px 36px #16374c14; }
.topbar-actions-item, .topbar-user-menu-action { font-family: 'Assistant', sans-serif; font-size: 13px; color: var(--shell-ink); border-radius: 8px; }
.topbar-actions-item:hover, .topbar-user-menu-action:hover { background: #f0f8fa; color: #087f9c; }
.topbar-user-menu-head { background: #f7fafc; border: 0; border-radius: 9px; padding: 12px; }
.sidebar :is(button, [tabindex]):focus-visible, .topbar :is(button, [tabindex]):focus-visible { outline: 2px solid #009fba; outline-offset: 3px; }
@media (max-height: 780px) {
  .sidebar-logo { min-height: 82px; padding-block: 14px; }
  .sidebar-context { padding-block: 10px; margin-bottom: 6px; }
  .sidebar-context-sub { font-size: 10px; }
  .sidebar .nav-section { margin-bottom: 7px; }
  .sidebar .nav-item { min-height: 34px; padding-block: 6px; }
  .sidebar-bottom { padding-block: 12px; }
}
@media (max-width: 1200px) {
  .topbar { padding-inline: 18px; gap: 9px; }
  .topbar-date { max-width: 150px; }
  .topbar-date span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 980px) {
  .topbar { flex-wrap: wrap; height: auto; min-height: 64px; padding-block: 10px; }
  .topbar-title { flex-basis: 100%; font-size: 16px; }
  .topbar-date { flex: 1 1 24px; min-width: 24px; max-width: none; margin-inline-end: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar *, .topbar * { transition: none !important; }
}
