      :root {
        --bg: #f4f5fb;
        --bg-card: #ffffff;
        --bg-card-soft: #eceef6;
        --accent: #d79922;
        --accent-secondary: #4056a1;
        --accent-secondary-soft: rgba(64, 86, 161, 0.08);
        --accent-secondary-strong: rgba(64, 86, 161, 0.2);
        --accent-soft: rgba(215, 153, 34, 0.14);
        --accent-strong: rgba(215, 153, 34, 0.26);
        --text-main: #343646;
        --text-muted: #787e96;
        --border-subtle: rgba(64, 86, 161, 0.12);
        --border-strong: rgba(64, 86, 161, 0.18);
        --surface-muted: rgba(197, 203, 227, 0.16);
        --surface-frost: rgba(255, 255, 255, 0.88);
        --body-gradient-start: #d9def1;
        --sidebar-bg: rgba(248, 249, 253, 0.94);
        --sidebar-border: rgba(64, 86, 161, 0.16);
        --brand-surface: rgba(255, 255, 255, 0.94);
        --brand-border: rgba(64, 86, 161, 0.16);
        --brand-shadow: 0 12px 24px rgba(64, 86, 161, 0.14);
        --badge-bg: rgba(233, 236, 245, 0.82);
        --badge-border: rgba(64, 86, 161, 0.18);
        --toggle-bg: #eceef6;
        --toggle-thumb: rgba(123, 132, 172, 0.72);
        --toggle-active: #8b94bd;
        --toggle-active-soft: rgba(139, 148, 189, 0.22);
        --toggle-active-strong: rgba(139, 148, 189, 0.34);
        --button-accent: var(--accent);
        --button-accent-soft: var(--accent-soft);
        --button-accent-strong: var(--accent-strong);
        --button-shadow: 0 4px 14px rgba(215, 153, 34, 0.18);
        --sidebar-text-main: #343646;
        --sidebar-text-muted: #6571a0;
        --sidebar-active-bg: rgba(64, 86, 161, 0.12);
        --sidebar-active-text: #4056a1;
        --sidebar-dot: #d79922;
        --sidebar-badge-bg: rgba(64, 86, 161, 0.08);
        --sidebar-badge-border: rgba(64, 86, 161, 0.18);
        --sidebar-badge-text: #4d5f96;
        --console-bg: rgba(241, 60, 32, 0.05);
        --console-border: rgba(241, 60, 32, 0.16);
        --console-title: #d44d30;
        --console-count-bg: rgba(241, 60, 32, 0.12);
        --console-count-text: #c53e24;
        --console-item-bg: rgba(255, 255, 255, 0.8);
        --console-item-border: rgba(241, 60, 32, 0.1);
        --console-chip-bg: rgba(241, 60, 32, 0.1);
        --console-chip-text: #bd381f;
        --overlay-bg: rgba(31, 26, 25, 0.4);
        --panel-accent-gradient: linear-gradient(
          135deg,
          rgba(215, 153, 34, 0.16),
          rgba(255, 249, 239, 0)
        );
        --panel-secondary-gradient: linear-gradient(
          135deg,
          var(--accent-secondary-soft),
          rgba(255, 249, 239, 0)
        );
        --table-row-hover: rgba(64, 86, 161, 0.06);
        --chart-grid: rgba(64, 86, 161, 0.14);
        --accent-shadow: 0 4px 14px rgba(215, 153, 34, 0.16);
        --radius-xl: 18px;
        --shadow-soft: 0 18px 42px rgba(64, 86, 161, 0.1);
        --sidebar-width: 230px;
      }

      :root[data-theme='dark'] {
        --bg: #1f1a19;
        --bg-card: #2b2524;
        --bg-card-soft: rgba(144, 144, 143, 0.12);
        --accent: #cb7211;
        --accent-secondary: #c5bbb4;
        --accent-secondary-soft: rgba(197, 187, 180, 0.12);
        --accent-secondary-strong: rgba(197, 187, 180, 0.24);
        --accent-soft: rgba(203, 114, 17, 0.16);
        --accent-strong: rgba(203, 114, 17, 0.28);
        --text-main: #f6eee3;
        --text-muted: #90908f;
        --border-subtle: rgba(129, 129, 133, 0.3);
        --border-strong: rgba(203, 114, 17, 0.24);
        --surface-muted: rgba(144, 144, 143, 0.14);
        --surface-frost: rgba(42, 37, 36, 0.88);
        --body-gradient-start: #3d2c27;
        --sidebar-bg: rgba(31, 26, 25, 0.94);
        --sidebar-border: rgba(203, 114, 17, 0.18);
        --brand-surface: rgba(203, 114, 17, 0.08);
        --brand-border: rgba(129, 129, 133, 0.34);
        --brand-shadow: none;
        --badge-bg: rgba(144, 144, 143, 0.08);
        --badge-border: rgba(129, 129, 133, 0.28);
        --toggle-bg: rgba(144, 144, 143, 0.18);
        --toggle-thumb: rgba(144, 144, 143, 0.92);
        --toggle-active: #a3e635;
        --toggle-active-soft: rgba(163, 230, 53, 0.16);
        --toggle-active-strong: rgba(163, 230, 53, 0.32);
        --button-accent: #a3e635;
        --button-accent-soft: rgba(163, 230, 53, 0.16);
        --button-accent-strong: rgba(163, 230, 53, 0.32);
        --button-shadow: 0 4px 16px rgba(163, 230, 53, 0.18);
        --sidebar-text-main: #f6eee3;
        --sidebar-text-muted: #beb8b3;
        --sidebar-active-bg: rgba(163, 230, 53, 0.14);
        --sidebar-active-text: #d9f99d;
        --sidebar-dot: #a3e635;
        --sidebar-badge-bg: rgba(163, 230, 53, 0.08);
        --sidebar-badge-border: rgba(163, 230, 53, 0.2);
        --sidebar-badge-text: #d9f99d;
        --console-bg: rgba(163, 230, 53, 0.08);
        --console-border: rgba(163, 230, 53, 0.18);
        --console-title: #d9f99d;
        --console-count-bg: rgba(163, 230, 53, 0.14);
        --console-count-text: #d9f99d;
        --console-item-bg: rgba(66, 78, 26, 0.18);
        --console-item-border: rgba(163, 230, 53, 0.14);
        --console-chip-bg: rgba(163, 230, 53, 0.14);
        --console-chip-text: #d9f99d;
        --overlay-bg: rgba(16, 13, 12, 0.68);
        --panel-accent-gradient: linear-gradient(
          135deg,
          rgba(203, 114, 17, 0.2),
          rgba(31, 26, 25, 0)
        );
        --panel-secondary-gradient: linear-gradient(
          135deg,
          var(--accent-secondary-soft),
          rgba(31, 26, 25, 0)
        );
        --table-row-hover: rgba(144, 144, 143, 0.1);
        --chart-grid: rgba(129, 129, 133, 0.22);
        --accent-shadow: 0 4px 16px rgba(203, 114, 17, 0.2);
        --shadow-soft: 0 26px 60px rgba(8, 6, 6, 0.5);
      }

      * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
      }

      [hidden] {
        display: none !important;
      }

      body {
        font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text',
          sans-serif;
        background: radial-gradient(
          circle at top left,
          var(--body-gradient-start),
          var(--bg)
        );
        color: var(--text-main);
        min-height: 100vh;
        display: flex;
        align-items: flex-start;
      }

      body.sidebar-resizing,
      body.sidebar-resizing * {
        cursor: ew-resize !important;
        user-select: none;
      }

      .sidebar {
        width: var(--sidebar-width);
        flex: 0 0 var(--sidebar-width);
        height: 100vh;
        height: 100dvh;
        padding: 20px 18px;
        display: flex;
        flex-direction: column;
        gap: 18px;
        align-self: flex-start;
        position: sticky;
        top: 0;
        overflow-y: auto;
        overflow-x: visible;
        border-right: 1px solid var(--sidebar-border);
        background: var(--sidebar-bg);
        backdrop-filter: blur(18px);
        z-index: 20;
      }

      .sidebar-resizer {
        width: 10px;
        flex: 0 0 10px;
        position: relative;
        cursor: ew-resize;
        align-self: stretch;
      }

      .sidebar-resizer::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(
          180deg,
          transparent,
          rgba(64, 86, 161, 0.1),
          transparent
        );
      }

      .sidebar-resizer::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 4px;
        height: 54px;
        border-radius: 999px;
        background: rgba(64, 86, 161, 0.18);
        transition: background 0.15s ease;
      }

      .sidebar-resizer:hover::after,
      body.sidebar-resizing .sidebar-resizer::after {
        background: rgba(64, 86, 161, 0.34);
      }

      .brand {
        display: flex;
        align-items: center;
        gap: 12px;
        min-width: 0;
        position: relative;
      }
      .brand-trigger {
        width: 100%;
        flex: 1 1 auto;
        border: none;
        background: transparent;
        padding: 0 2px 0 0;
        display: flex;
        align-items: center;
        gap: 12px;
        min-width: 0;
        text-align: left;
        cursor: pointer;
      }
      .brand-trigger:hover .brand-avatar,
      .brand-trigger:focus-visible .brand-avatar {
        border-color: rgba(64, 86, 161, 0.26);
      }
      .brand-avatar {
        width: 44px;
        height: 44px;
        flex: 0 0 auto;
        border-radius: 14px;
        background: var(--brand-surface);
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        border: 1px solid var(--brand-border);
        box-shadow: var(--brand-shadow);
      }
      .brand-avatar img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
      }
      .brand-avatar-fallback {
        font-size: 18px;
        font-weight: 700;
        color: var(--sidebar-text-main);
      }
      .brand-text {
        display: flex;
        flex-direction: column;
        min-width: 0;
      }
      .brand-title {
        font-size: 15px;
        font-weight: 600;
        line-height: 1.2;
        color: var(--sidebar-text-main);
      }
      .brand-subtitle {
        font-size: 12px;
        color: var(--sidebar-text-muted);
        line-height: 1.3;
      }
      .brand-chevron {
        margin-left: auto;
        color: var(--sidebar-text-muted);
        font-size: 12px;
        transition: transform 0.18s ease;
      }
      .brand.open .brand-chevron {
        transform: rotate(180deg);
      }
      .brand-icon-btn {
        width: 36px;
        height: 36px;
        flex: 0 0 auto;
        border: 1px solid var(--brand-border);
        border-radius: 10px;
        background: var(--brand-surface);
        color: var(--sidebar-text-main);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        position: relative;
      }
      .brand-icon-btn .icon {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
      }
      .brand-icon-btn:hover,
      .brand-icon-btn:focus-visible,
      .brand-icon-btn.has-notifications {
        border-color: rgba(64, 86, 161, 0.34);
        box-shadow: var(--brand-shadow);
      }
      .notification-dot {
        position: absolute;
        top: -5px;
        right: -5px;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 999px;
        background: #dc2626;
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        line-height: 18px;
        text-align: center;
      }
      .notifications-popover {
        position: fixed;
        top: 8px;
        right: 8px;
        bottom: 8px;
        left: auto;
        width: min(820px, calc(100vw - 296px));
        max-width: calc(100vw - 16px);
        min-width: min(420px, calc(100vw - 16px));
        height: auto;
        max-height: none;
        border-radius: 14px;
        border: 1px solid var(--border-subtle);
        background: var(--bg-card);
        box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
        z-index: 2400;
        overflow: hidden;
        display: flex;
        flex-direction: column;
      }
      .notifications-head {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 16px;
        border-bottom: 1px solid var(--border-subtle);
      }
      .notifications-title {
        font-size: 20px;
        font-weight: 650;
        color: var(--text-main);
      }
      .notifications-subtitle {
        margin-top: 3px;
        color: var(--text-muted);
        font-size: 13px;
      }
      .notifications-tabs {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
        padding: 10px;
        border-bottom: 1px solid var(--border-subtle);
        background: var(--surface-muted);
      }
      .notifications-tabs button {
        min-height: 34px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: var(--text-muted);
        cursor: pointer;
      }
      .notifications-tabs button.active {
        background: var(--bg-card);
        color: var(--text-main);
      }
      .notifications-list {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        overflow: auto;
      }
      .notification-item {
        display: grid;
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 10px;
        padding: 14px 16px;
        border-bottom: 1px solid var(--border-subtle);
      }
      .notification-icon {
        width: 32px;
        height: 32px;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--surface-muted);
        color: var(--text-main);
        font-weight: 700;
      }
      .notification-item.overdue .notification-icon {
        background: rgba(220, 38, 38, 0.14);
        color: #dc2626;
      }
      .notification-title {
        color: var(--text-main);
        font-weight: 600;
        line-height: 1.35;
      }
      .notification-meta {
        margin-top: 5px;
        color: var(--text-muted);
        font-size: 12px;
      }
      @media (max-width: 760px) {
        .notifications-popover {
          inset: 6px;
          width: auto;
          min-width: 0;
          max-width: none;
        }
        .notifications-tabs {
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }
      }
      .space-switcher-popover {
        position: fixed;
        top: var(--space-switcher-top, 84px);
        left: var(--space-switcher-left, 18px);
        width: min(286px, calc(100vw - 24px));
        max-height: calc(100dvh - var(--space-switcher-top, 84px) - 18px);
        padding: 10px;
        border-radius: 18px;
        border: 1px solid var(--border-subtle);
        background: rgba(255, 255, 255, 0.97);
        box-shadow: 0 18px 36px rgba(64, 86, 161, 0.18);
        z-index: 1700;
        display: flex;
        flex-direction: column;
        gap: 8px;
        overflow-y: auto;
      }
      [data-theme='dark'] .space-switcher-popover {
        background: rgba(24, 21, 20, 0.96);
        box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
      }
      .space-switcher-head {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px;
        border-radius: 14px;
        background: rgba(64, 86, 161, 0.06);
        border: 1px solid rgba(64, 86, 161, 0.08);
      }
      [data-theme='dark'] .space-switcher-head {
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(255, 255, 255, 0.06);
      }
      .space-switcher-head-main {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
        flex: 1 1 auto;
      }
      .space-switcher-head-name {
        font-size: 15px;
        line-height: 1.2;
        font-weight: 700;
        color: var(--sidebar-text-main);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .space-switcher-head-meta {
        font-size: 11px;
        color: var(--sidebar-text-muted);
        line-height: 1.3;
      }
      .space-switcher-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
      }
      .space-switcher-action {
        width: 100%;
        justify-content: center;
        min-height: 36px;
        padding: 8px 10px;
      }
      .space-switcher-section {
        display: flex;
        flex-direction: column;
        gap: 6px;
      }
      .space-switcher-title {
        font-size: 9px;
        text-transform: uppercase;
        letter-spacing: 0.12em;
        color: var(--sidebar-text-muted);
      }
      .space-switcher-row {
        display: flex;
        align-items: center;
        gap: 8px;
      }
      .space-switcher-input {
        width: 100%;
        min-width: 0;
      }
      .space-switcher-list {
        display: flex;
        flex-direction: column;
        gap: 6px;
        max-height: 180px;
        overflow: auto;
      }
      .space-switcher-item {
        width: 100%;
        border: 1px solid var(--border-subtle);
        border-radius: 16px;
        background: transparent;
        padding: 8px 9px;
        display: flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
        color: var(--sidebar-text-main);
      }
      .space-switcher-item:hover,
      .space-switcher-item:focus-visible {
        background: rgba(64, 86, 161, 0.08);
      }
      .space-switcher-item.current {
        border-color: rgba(64, 86, 161, 0.28);
        background: rgba(64, 86, 161, 0.08);
      }
      .space-switcher-item-avatar {
        width: 30px;
        height: 30px;
        border-radius: 10px;
        background: var(--brand-surface);
        border: 1px solid var(--brand-border);
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
      }
      .space-switcher-item-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
      .space-switcher-item-main {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 1px;
        flex: 1 1 auto;
      }
      .space-switcher-item-name {
        font-size: 11px;
        font-weight: 600;
        color: var(--sidebar-text-main);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .space-switcher-item-meta {
        font-size: 9px;
        color: var(--sidebar-text-muted);
      }
      .space-switcher-badge {
        border-radius: 999px;
        padding: 3px 6px;
        font-size: 8px;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        border: 1px solid var(--border-subtle);
        color: var(--sidebar-text-main);
      }
      .space-switcher-badge.admin {
        color: var(--accent-gold);
        border-color: rgba(203, 114, 17, 0.32);
        background: rgba(203, 114, 17, 0.08);
      }
      .space-switcher-empty {
        font-size: 12px;
        color: var(--sidebar-text-muted);
        padding: 4px 2px;
      }
      .space-switcher-create {
        display: flex;
        align-items: center;
        gap: 8px;
      }
      .space-switcher-create .btn {
        flex: 0 0 auto;
      }
      .space-settings-card {
        display: grid;
        grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
        gap: 16px;
        align-items: start;
      }
      .space-settings-preview {
        display: flex;
        flex-direction: column;
        gap: 12px;
      }
      .space-settings-avatar-preview {
        width: 108px;
        height: 108px;
        border-radius: 26px;
        background: var(--brand-surface);
        border: 1px solid var(--brand-border);
        box-shadow: var(--brand-shadow);
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
      }
      .space-settings-avatar-preview img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
      .space-settings-avatar-preview .brand-avatar-fallback {
        font-size: 42px;
      }
      .space-settings-form {
        display: flex;
        flex-direction: column;
        gap: 12px;
        min-width: 0;
      }
      .space-settings-field {
        display: flex;
        flex-direction: column;
        gap: 6px;
        font-size: 12px;
        color: var(--sidebar-text-muted);
      }
      .space-settings-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }
      .space-chip-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }
      .space-emoji-chip,
      .space-color-chip {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        border: 1px solid var(--border-subtle);
        background: transparent;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: var(--sidebar-text-main);
        transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
      }
      .space-emoji-chip:hover,
      .space-color-chip:hover,
      .space-emoji-chip:focus-visible,
      .space-color-chip:focus-visible {
        transform: translateY(-1px);
        border-color: rgba(64, 86, 161, 0.32);
      }
      .space-emoji-chip.active,
      .space-color-chip.active {
        border-color: rgba(64, 86, 161, 0.38);
        box-shadow: 0 0 0 3px rgba(64, 86, 161, 0.1);
      }
      .space-emoji-chip {
        font-size: 18px;
      }
      .space-color-chip::after {
        content: '';
        width: 20px;
        height: 20px;
        border-radius: 999px;
        background: var(--chip-color, #dbe4ff);
      }
      .space-settings-note {
        font-size: 12px;
        color: var(--sidebar-text-muted);
      }

      @media (max-width: 980px) {
        .space-settings-card {
          grid-template-columns: 1fr;
        }
      }

      .nav-section-title {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: var(--sidebar-text-muted);
        margin-top: 8px;
        margin-bottom: 6px;
      }

      .sidebar-primary-content,
      .sidebar-mode-panel {
        display: flex;
        flex-direction: column;
        gap: 12px;
        min-width: 0;
      }

      .sidebar-back-btn {
        width: 100%;
        min-height: 44px;
        padding: 10px 14px;
        border: 1px solid var(--sidebar-badge-border);
        border-radius: 14px;
        background: var(--sidebar-badge-bg);
        color: var(--sidebar-text-main);
        font-size: 14px;
        font-weight: 600;
        text-align: left;
        cursor: pointer;
        transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
      }

      .sidebar-back-btn:hover,
      .sidebar-back-btn:focus-visible {
        border-color: var(--border-strong);
        background: var(--sidebar-active-bg);
        transform: translateY(-1px);
      }

      #navList {
        display: flex;
        flex-direction: column;
        gap: 2px;
      }

      .nav-item {
        padding: 8px 10px;
        width: 100%;
        border: none;
        background: transparent;
        border-radius: 12px;
        font-size: 13px;
        color: var(--sidebar-text-muted);
        display: flex;
        align-items: center;
        gap: 8px;
        text-align: left;
        cursor: grab;
        user-select: none;
        transition: background 0.15s ease, color 0.15s ease;
      }

      .nav-item-group {
        align-items: stretch;
        flex-direction: column;
        gap: 6px;
        cursor: default;
        padding: 0;
      }

      .nav-item-group .nav-row {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
        width: 100%;
        cursor: grab;
        padding: 8px 10px;
        border-radius: 12px;
        transition: background 0.15s ease, color 0.15s ease;
      }

      .nav-label {
        flex: 1 1 auto;
        min-width: 0;
      }

      .nav-rename-btn {
        width: 24px;
        height: 24px;
        border: 1px solid transparent;
        border-radius: 8px;
        background: transparent;
        color: inherit;
        cursor: pointer;
        opacity: 0;
        transition: opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease;
      }

      .nav-item:hover .nav-rename-btn,
      .nav-item:focus-within .nav-rename-btn {
        opacity: 1;
      }

      .nav-rename-btn:hover {
        border-color: var(--border-subtle);
        background: rgba(255, 255, 255, 0.08);
      }

      .nav-item:active {
        cursor: grabbing;
      }
      .nav-item:not(.nav-item-group):hover,
      .nav-item:not(.nav-item-group):focus-within {
        background: rgba(64, 86, 161, 0.08);
        color: var(--sidebar-text-main);
      }

      .nav-item-group:hover .nav-row,
      .nav-item-group:focus-within .nav-row {
        background: rgba(64, 86, 161, 0.08);
        color: var(--sidebar-text-main);
      }
      .nav-item.active {
        background: var(--sidebar-active-bg);
        color: var(--sidebar-active-text);
        font-weight: 500;
      }

      .nav-item-group.active {
        background: transparent;
        color: var(--sidebar-text-muted);
        font-weight: 400;
      }

      .nav-item-group.active .nav-row {
        background: var(--sidebar-active-bg);
        color: var(--sidebar-active-text);
        border-radius: 12px;
        font-weight: 500;
      }
      .nav-dot {
        width: 8px;
        height: 8px;
        border-radius: 999px;
        background: var(--sidebar-dot);
      }
      .nav-item.dragging {
        opacity: 0.6;
      }

      .nav-item-shortcut {
        margin-top: 8px;
        padding: 10px 12px;
        border: 1px solid var(--sidebar-badge-border);
        background: var(--sidebar-badge-bg);
        color: var(--sidebar-text-main);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
        cursor: pointer;
      }

      .nav-item-shortcut:hover,
      .nav-item-shortcut:focus-visible {
        border-color: var(--border-strong);
        background: var(--sidebar-active-bg);
        color: var(--sidebar-text-main);
      }

      .nav-item-shortcut.active {
        border-color: var(--sidebar-badge-border);
        background: var(--sidebar-active-bg);
        color: var(--sidebar-active-text);
        font-weight: 600;
      }

      .nav-shortcut-icon {
        width: 22px;
        height: 22px;
        border-radius: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: rgba(99, 102, 241, 0.14);
        color: #4f46e5;
        font-size: 13px;
        font-weight: 700;
        flex: 0 0 auto;
      }

      .nav-item-archive .nav-shortcut-icon {
        background: rgba(148, 163, 184, 0.16);
        color: var(--sidebar-text-main);
      }

      .nav-tree-btn {
        width: 24px;
        height: 24px;
        border: 1px solid transparent;
        border-radius: 8px;
        background: transparent;
        color: inherit;
        cursor: pointer;
        font-size: 14px;
        line-height: 1;
      }

      .nav-tree-btn:hover {
        border-color: var(--border-subtle);
        background: rgba(255, 255, 255, 0.08);
      }

      .nav-subtree {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding-left: 18px;
      }

      .finance-nav-project {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 6px 8px;
        border-radius: 12px;
        font-size: 12px;
        color: var(--sidebar-text-muted);
        cursor: pointer;
        min-width: 0;
      }

      .finance-nav-project.dragging {
        opacity: 0.55;
      }

      .finance-nav-project:hover {
        background: rgba(64, 86, 161, 0.08);
      }

      .finance-nav-project.active {
        background: var(--sidebar-active-bg);
        color: var(--sidebar-active-text);
        font-weight: 500;
      }

      .finance-nav-project-badge {
        width: 22px;
        height: 22px;
        border-radius: 8px;
        background: rgba(56, 189, 248, 0.18);
        color: #0f766e;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        font-weight: 700;
        flex: 0 0 auto;
      }

      .finance-nav-project-name {
        flex: 1 1 auto;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .finance-nav-project-actions {
        display: inline-flex;
        gap: 4px;
        opacity: 0;
        transition: opacity 0.15s ease;
      }

      .finance-nav-project:hover .finance-nav-project-actions,
      .finance-nav-project:focus-within .finance-nav-project-actions {
        opacity: 1;
      }

      .finance-nav-action {
        width: 22px;
        height: 22px;
        border: 1px solid transparent;
        border-radius: 7px;
        background: transparent;
        color: inherit;
        cursor: pointer;
        font-size: 12px;
        line-height: 1;
      }

      .finance-nav-action:hover {
        border-color: var(--border-subtle);
        background: rgba(255, 255, 255, 0.08);
      }

      .finance-nav-project-access {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 18px;
        color: var(--sidebar-text-muted);
        font-size: 11px;
        line-height: 1;
      }

      .finance-nav-empty {
        font-size: 11px;
        color: var(--sidebar-text-muted);
        padding: 2px 8px 6px;
      }

      .sidebar-meta {
        margin-top: auto;
        display: flex;
        flex-direction: column;
        gap: 12px;
        position: relative;
      }

      .sidebar-settings-btn {
        width: 100%;
        border: none;
        background: transparent;
        text-align: left;
        cursor: pointer;
      }

      .sidebar-settings-icon {
        width: 18px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 15px;
        flex: 0 0 auto;
      }

      .sidebar-account-menu {
        position: relative;
      }

      .account-menu-trigger {
        width: 100%;
        border: 1px solid var(--border-subtle);
        border-radius: 16px;
        background: var(--panel-surface, var(--brand-surface));
        color: var(--sidebar-text-main);
        padding: 10px 12px;
        display: flex;
        align-items: center;
        gap: 12px;
        cursor: pointer;
        text-align: left;
        box-shadow: var(--brand-shadow);
        transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
      }

      .account-menu-trigger:hover,
      .account-menu-trigger:focus-visible,
      .account-menu-trigger.open {
        border-color: var(--sidebar-badge-border);
        background: var(--sidebar-active-bg);
      }

      .account-menu-trigger:active {
        transform: translateY(1px);
      }

      .account-menu-trigger-avatar,
      .account-menu-avatar {
        width: 40px;
        height: 40px;
        flex: 0 0 auto;
        border-radius: 12px;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--brand-surface);
        border: 1px solid var(--brand-border);
        box-shadow: var(--brand-shadow);
      }

      .account-menu-avatar {
        width: 52px;
        height: 52px;
        border-radius: 16px;
      }

      .account-menu-trigger-avatar img,
      .account-menu-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
      }

      .account-menu-trigger-main,
      .account-menu-head-main,
      .account-menu-item-body {
        min-width: 0;
        display: flex;
        flex-direction: column;
      }

      .account-menu-trigger-main,
      .account-menu-head-main {
        gap: 2px;
        flex: 1 1 auto;
      }

      .account-menu-trigger-name,
      .account-menu-head-name {
        color: var(--sidebar-text-main);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .account-menu-trigger-name {
        font-size: 14px;
        font-weight: 600;
      }

      .account-menu-head-name {
        font-size: 16px;
        font-weight: 700;
      }

      .account-menu-trigger-meta,
      .account-menu-head-meta {
        font-size: 11px;
        line-height: 1.35;
        color: var(--sidebar-text-muted);
      }

      .account-menu-trigger-meta {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .account-menu-trigger-chevron {
        margin-left: auto;
        color: var(--sidebar-text-muted);
        font-size: 12px;
        line-height: 1;
        transition: transform 0.18s ease;
      }

      .account-menu-trigger.open .account-menu-trigger-chevron {
        transform: rotate(180deg);
      }

      .account-menu-popover {
        position: fixed;
        top: var(--account-menu-top, 16px);
        left: var(--account-menu-left, 16px);
        width: min(320px, calc(100vw - 32px));
        max-width: calc(100vw - 32px);
        max-height: calc(100dvh - 32px);
        padding: 10px;
        border-radius: 20px;
        border: 1px solid var(--border-strong);
        background: var(--surface-frost);
        box-shadow: var(--shadow-soft);
        backdrop-filter: blur(20px);
        display: flex;
        flex-direction: column;
        gap: 8px;
        z-index: 1800;
        overflow-y: auto;
      }

      .account-menu-head {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px;
        border-radius: 16px;
        background: var(--panel-bg, var(--surface-muted));
        border: 1px solid var(--border-subtle);
      }

      .account-menu-head-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 4px 8px;
        border-radius: 999px;
        border: 1px solid var(--badge-border);
        background: var(--badge-bg);
        color: var(--accent);
        font-size: 10px;
        font-weight: 700;
        white-space: nowrap;
      }

      .account-menu-section {
        display: flex;
        flex-direction: column;
        gap: 4px;
      }

      .account-menu-divider {
        height: 1px;
        margin: 4px 2px;
        background: var(--border-subtle);
      }

      .account-menu-item {
        width: 100%;
        border: none;
        border-radius: 14px;
        background: transparent;
        color: inherit;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px;
        text-align: left;
      }

      button.account-menu-item {
        cursor: pointer;
      }

      .account-menu-item:hover,
      .account-menu-item:focus-within,
      button.account-menu-item:focus-visible {
        background: var(--sidebar-active-bg);
      }

      button.account-menu-item:disabled {
        opacity: 0.55;
        cursor: not-allowed;
      }

      .account-menu-item-icon {
        width: 32px;
        height: 32px;
        flex: 0 0 auto;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--border-subtle);
        background: var(--panel-bg, var(--surface-muted));
        color: var(--text-main);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.08em;
      }

      .account-menu-item-body {
        gap: 2px;
        flex: 1 1 auto;
      }

      .account-menu-item-title {
        font-size: 13px;
        line-height: 1.25;
        font-weight: 600;
        color: var(--text-main);
      }

      .account-menu-item-meta {
        font-size: 11px;
        line-height: 1.35;
        color: var(--text-muted);
      }

      .account-menu-item-side {
        margin-left: auto;
        display: inline-flex;
        align-items: center;
        gap: 10px;
        flex: 0 0 auto;
      }

      .account-menu-item-value {
        font-size: 11px;
        color: var(--text-muted);
        white-space: nowrap;
      }

      .account-menu-switch {
        gap: 0;
        flex: 0 0 auto;
      }

      .account-menu-logout .account-menu-item-title,
      .account-menu-logout .account-menu-item-icon {
        color: #d44d30;
      }

      .account-menu-logout .account-menu-item-icon {
        border-color: rgba(212, 77, 48, 0.18);
        background: rgba(212, 77, 48, 0.08);
      }

      .admin-error-console {
        padding: 10px;
        border-radius: 16px;
        border: 1px solid var(--console-border);
        background: var(--console-bg);
      }

      .admin-error-console-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 8px;
      }

      .admin-error-console-title {
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--console-title);
      }

      .admin-error-console-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 18px;
        height: 18px;
        padding: 0 6px;
        border-radius: 999px;
        background: var(--console-count-bg);
        color: var(--console-count-text);
        font-size: 10px;
        font-weight: 600;
      }

      .admin-error-console-list {
        display: flex;
        flex-direction: column;
        gap: 6px;
        max-height: 180px;
        overflow-y: auto;
      }

      .admin-error-console-empty {
        font-size: 11px;
        line-height: 1.4;
        color: var(--text-muted);
      }

      .admin-error-console-item {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 8px;
        border-radius: 12px;
        background: var(--console-item-bg);
        border: 1px solid var(--console-item-border);
      }

      .admin-error-console-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
      }

      .admin-error-console-source {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
      }

      .admin-error-console-chip {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 2px 6px;
        border-radius: 999px;
        background: var(--console-chip-bg);
        color: var(--console-chip-text);
        font-size: 10px;
        font-weight: 600;
      }

      .admin-error-console-time {
        font-size: 10px;
        color: var(--text-muted);
        white-space: nowrap;
      }

      .admin-error-console-message {
        font-size: 11px;
        line-height: 1.4;
        color: var(--text-main);
        word-break: break-word;
      }

      .admin-error-console-meta {
        font-size: 10px;
        color: var(--text-muted);
        word-break: break-word;
      }

      .admin-error-console-actions {
        display: flex;
        justify-content: flex-end;
        margin-top: 8px;
      }

      .admin-diagnostics-console {
        padding: 10px;
        border-radius: 16px;
        border: 1px solid var(--border-subtle);
        background: var(--panel-bg);
      }

      .admin-diagnostics-console-header {
        display: flex;
        align-items: flex-start;
        gap: 8px;
      }

      .admin-diagnostics-toggle {
        flex: 1 1 auto;
        border: none;
        background: transparent;
        color: inherit;
        cursor: pointer;
        text-align: left;
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        min-width: 0;
      }

      .admin-diagnostics-heading {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
      }

      .admin-diagnostics-summary {
        font-size: 11px;
        line-height: 1.4;
        color: var(--text-muted);
      }

      .admin-diagnostics-chevron {
        font-size: 12px;
        color: var(--text-muted);
        transition: transform 0.18s ease;
      }

      .admin-diagnostics-toggle[aria-expanded='true'] .admin-diagnostics-chevron {
        transform: rotate(180deg);
      }

      .admin-diagnostics-refresh {
        flex: 0 0 auto;
        min-height: 30px;
        padding: 6px 10px;
      }

      .admin-diagnostics-body {
        margin-top: 10px;
        display: flex;
        flex-direction: column;
        gap: 8px;
      }

      .admin-diagnostics-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
      }

      .admin-diagnostics-card {
        padding: 10px;
        border-radius: 12px;
        background: var(--console-item-bg);
        border: 1px solid var(--border-subtle);
      }

      .admin-diagnostics-card-title {
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--text-muted);
      }

      .admin-diagnostics-card-value {
        margin-top: 6px;
        font-size: 18px;
        line-height: 1.1;
        font-weight: 700;
        color: var(--text-main);
        letter-spacing: -0.03em;
      }

      .admin-diagnostics-card-meta {
        margin-top: 4px;
        font-size: 11px;
        line-height: 1.4;
        color: var(--text-muted);
      }

      .admin-diagnostics-list {
        margin-top: 8px;
        display: flex;
        flex-direction: column;
        gap: 6px;
      }

      .admin-diagnostics-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        font-size: 11px;
      }

      .admin-diagnostics-key {
        color: var(--text-muted);
      }

      .admin-diagnostics-value-inline {
        color: var(--text-main);
        font-weight: 600;
        text-align: right;
        word-break: break-word;
      }

      .sidebar-footer {
        font-size: 11px;
        color: var(--sidebar-text-muted);
      }

      .sidebar .badge {
        background: var(--sidebar-badge-bg);
        border-color: var(--sidebar-badge-border);
        color: var(--sidebar-badge-text);
      }

      .sidebar .btn.secondary {
        background: var(--sidebar-badge-bg);
        border-color: var(--sidebar-badge-border);
        color: var(--sidebar-badge-text);
      }

      .main {
        flex: 1;
        min-width: 0;
        padding: 18px 22px 22px;
        display: flex;
        flex-direction: column;
        gap: 12px;
        background: transparent;
      }

      .main-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
      }

      .main-title-block {
        display: flex;
        flex-direction: column;
        gap: 4px;
      }
      .main-title {
        font-size: 22px;
        font-weight: 600;
        letter-spacing: -0.03em;
      }
      .main-subtitle {
        font-size: 13px;
        color: var(--text-muted);
      }

      .badge {
        font-size: 11px;
        padding: 4px 9px;
        border-radius: 999px;
        border: 1px solid var(--badge-border);
        background: var(--badge-bg);
        color: var(--text-muted);
      }

      .main-header-right {
        display: flex;
        align-items: center;
        gap: 8px;
      }

      .layout {
        display: grid;
        grid-template-columns: minmax(0, 1.7fr) 320px;
        gap: 16px;
      }
      .layout.collapsed-right {
        grid-template-columns: minmax(0, 1fr);
      }
      .layout.collapsed-right aside.panel {
        display: none;
      }

      .panel {
        background: var(--bg-card);
        border-radius: 22px;
        border: 1px solid var(--border-subtle);
        box-shadow: var(--shadow-soft);
        padding: 14px;
      }

      .panel-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
      }

      .panel-title {
        font-size: 13px;
        font-weight: 500;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.08em;
      }

      .panel-subtitle {
        font-size: 12px;
        color: var(--text-muted);
      }

      .panel-subtitle:empty {
        display: none;
      }

      .tabs {
        display: inline-flex;
        padding: 3px;
        border-radius: 999px;
        background: var(--bg-card-soft);
        border: 1px solid var(--border-strong);
        gap: 2px;
      }
      .tab {
        padding: 4px 10px;
        border-radius: 999px;
        font-size: 12px;
        cursor: pointer;
        color: var(--text-muted);
      }
      .tab.active {
        background: var(--accent-soft);
        color: var(--accent);
        font-weight: 500;
      }

      .filters {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 12px;
      }
      .filters select {
        font-size: 12px;
        border-radius: 999px;
        border: 1px solid var(--border-strong);
        padding: 3px 8px;
        background: var(--bg-card-soft);
        color: var(--text-main);
        max-width: 150px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .btn {
        font-size: 12px;
        padding: 4px 10px;
        border-radius: 999px;
        border: 1px solid var(--button-accent-strong);
        background: var(--button-accent-soft);
        color: var(--button-accent);
        cursor: pointer;
      }
      .btn.secondary {
        background: transparent;
        border-color: var(--border-strong);
        color: var(--text-muted);
      }
      .btn.danger {
        background: rgba(185, 28, 28, 0.08);
        color: #b91c1c;
        border-color: rgba(185, 28, 28, 0.24);
      }

      .btn.finance-income {
        background: rgba(34, 197, 94, 0.14);
        color: #15803d;
        border-color: rgba(34, 197, 94, 0.28);
      }

      .btn.finance-expense {
        background: rgba(251, 146, 60, 0.16);
        color: #c2410c;
        border-color: rgba(251, 146, 60, 0.28);
      }

      .btn.finance-category {
        background: rgba(56, 189, 248, 0.14);
        color: #0369a1;
        border-color: rgba(56, 189, 248, 0.28);
      }
      .btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
      }

      .theme-toggle {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 11px;
        color: var(--text-muted);
      }

      .theme-toggle[hidden] {
        display: none !important;
      }

      .theme-toggle input {
        appearance: none;
        width: 26px;
        height: 14px;
        border-radius: 999px;
        border: 1px solid var(--border-strong);
        background: var(--toggle-bg);
        position: relative;
        transition: 0.16s;
      }
      .theme-toggle input::before {
        content: '';
        width: 10px;
        height: 10px;
        border-radius: 999px;
        background: var(--toggle-thumb);
        position: absolute;
        top: 1.5px;
        left: 2px;
        transition: 0.16s;
      }
      .theme-toggle input:checked {
        background: var(--toggle-active-soft);
        border-color: var(--toggle-active-strong);
      }
      .theme-toggle input:checked::before {
        left: 13px;
        background: var(--toggle-active);
      }

      .widgets-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 12px;
      }

      .widget-card {
        background: radial-gradient(
          circle at top left,
          var(--accent-soft),
          var(--bg-card)
        );
        border-radius: 18px;
        padding: 12px;
        border: 1px solid var(--border-strong);
        user-select: none;
        touch-action: manipulation;
      }

      .widget-card.widget-wide {
        grid-column: span 2;
      }

      .widget-card.widget-timeline .chart-wrapper {
        height: 320px;
      }
      .widget-card.sortable {
        cursor: grab;
        touch-action: none;
      }
      .widget-card.sortable:active {
        cursor: grabbing;
      }
      .widget-card.dragging {
        opacity: 0.96;
        box-shadow: 0 24px 60px rgba(17, 24, 39, 0.18);
        cursor: grabbing;
        pointer-events: none;
        z-index: 30;
      }
      .widget-card.widget-placeholder {
        border-style: dashed;
        background: rgba(124, 58, 237, 0.08);
        min-height: 180px;
      }

      body.widget-drag-active,
      body.widget-drag-active * {
        user-select: none !important;
      }

      .widget-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 8px;
        gap: 8px;
      }

      .widget-title {
        font-size: 14px;
        font-weight: 500;
      }
      .widget-desc {
        font-size: 11px;
        color: var(--text-muted);
        margin-top: 2px;
      }

      .widget-badge {
        flex: 0 0 auto;
        align-self: flex-start;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 26px;
        padding: 0;
        line-height: 1;
        font-size: 10px;
        border-radius: 999px;
        background: var(--badge-bg);
        border: 1px solid var(--badge-border);
        color: var(--text-muted);
        text-align: center;
      }
      .widget-type-control {
        flex: 0 0 auto;
        align-self: flex-start;
        display: inline-flex;
        align-items: center;
        min-width: 64px;
        height: 28px;
        padding: 0 10px;
        border-radius: 999px;
        background: var(--badge-bg);
        border: 1px solid var(--badge-border);
        color: var(--text-muted);
      }
      .widget-type-select {
        width: 100%;
        appearance: none;
        border: 0;
        outline: none;
        background: transparent;
        color: inherit;
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        text-align: center;
        cursor: pointer;
      }
      .widget-type-select:disabled {
        cursor: default;
      }

      .widget-kpi-value {
        font-size: 24px;
        font-weight: 600;
      }
      .widget-kpi-hint {
        font-size: 11px;
        color: var(--text-muted);
      }

      .widget-total {
        margin-top: 6px;
        font-size: 11px;
        color: var(--text-muted);
      }

      .chart-wrapper {
        height: 190px;
        position: relative;
      }

      .widget-legend {
        margin-top: 4px;
        margin-bottom: 4px;
        max-height: 80px;
        overflow-y: auto;
        font-size: 11px;
      }
      .legend-item {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-bottom: 2px;
      }
      .legend-color {
        width: 18px;
        height: 4px;
        border-radius: 999px;
      }
      .legend-label {
        white-space: nowrap;
        color: var(--text-main);
      }

      .admin-panel {
        display: flex;
        flex-direction: column;
        gap: 10px;
      }
      .admin-list {
        margin-top: 4px;
      }

      .admin-row {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 7px 0;
        border-bottom: 1px dashed var(--border-subtle);
        font-size: 12px;
      }
      .admin-row-controls {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 6px;
      }
      .admin-widget-type-control {
        min-width: 88px;
      }
      .admin-widget-type-select {
        font-size: 10px;
      }

      .admin-pill-type {
        font-size: 10px;
        padding: 2px 6px;
        border-radius: 999px;
        background: var(--accent-soft);
        border: 1px solid var(--accent-strong);
        color: var(--accent);
      }

      .switch {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
      }
      .switch.disabled {
        opacity: 0.45;
        cursor: not-allowed;
      }
      .switch.disabled input {
        cursor: not-allowed;
      }

      .switch input {
        appearance: none;
        width: 30px;
        height: 16px;
        border-radius: 999px;
        border: 1px solid var(--border-strong);
        background: var(--toggle-bg);
        position: relative;
        transition: 0.16s;
      }
      .switch input::before {
        content: '';
        width: 12px;
        height: 12px;
        border-radius: 999px;
        background: var(--toggle-thumb);
        position: absolute;
        top: 1px;
        left: 2px;
        transition: 0.16s;
      }
      .switch input:checked {
        background: var(--toggle-active-soft);
        border-color: var(--toggle-active-strong);
      }
      .switch input:checked::before {
        left: 15px;
        background: var(--toggle-active);
      }

      .status-message {
        font-size: 11px;
        min-height: 14px;
        margin-top: 4px;
      }

      .project-admin-panel {
        margin-top: 14px;
        padding: 12px;
        border-radius: 18px;
        border: 1px dashed var(--border-strong);
        background: var(--panel-accent-gradient);
      }

      .project-admin-form {
        margin-top: 8px;
        display: grid;
        grid-template-columns: 160px minmax(220px, 1fr) minmax(240px, 1.2fr) auto auto;
        gap: 8px;
        align-items: center;
      }

      .admin-input {
        width: 100%;
        font-size: 12px;
        border-radius: 12px;
        border: 1px solid var(--border-strong);
        padding: 8px 10px;
        background: var(--bg-card);
        color: var(--text-main);
      }

      .project-admin-row {
        display: grid;
        grid-template-columns: minmax(120px, 0.65fr) minmax(180px, 1fr) minmax(220px, 1.2fr) auto;
        gap: 10px;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px dashed var(--border-subtle);
        font-size: 12px;
      }

      .project-admin-meta {
        min-width: 0;
      }

      .project-admin-code {
        display: inline-flex;
        align-items: center;
        padding: 2px 6px;
        border-radius: 999px;
        background: var(--surface-muted);
        color: var(--text-muted);
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
      }

      .project-admin-value {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .project-admin-actions {
        display: flex;
        gap: 6px;
        justify-content: flex-end;
      }

      .project-admin-empty {
        padding: 8px 0;
        font-size: 12px;
        color: var(--text-muted);
      }

      .user-admin-panel {
        margin-top: 14px;
        padding: 0;
        border-radius: 8px;
        border: 1px solid var(--border-subtle);
        background: color-mix(in srgb, var(--bg-card) 84%, transparent);
        overflow: hidden;
      }

      .team-command-bar {
        display: grid;
        grid-template-columns: auto minmax(320px, 1fr) auto auto auto;
        gap: 8px;
        align-items: center;
        padding: 10px;
        border-bottom: 1px solid var(--border-subtle);
        background: var(--surface-muted);
      }

      .team-view-tabs,
      .team-filter {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
      }

      .team-view-tab {
        min-height: 34px;
        padding: 0 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid transparent;
        border-radius: 8px;
        background: color-mix(in srgb, var(--bg-card) 58%, transparent);
        color: var(--text-muted);
        font-size: 13px;
        font-weight: 650;
        cursor: pointer;
        white-space: nowrap;
      }

      .team-view-tab:hover,
      .team-view-tab:focus-visible,
      .team-view-tab.active {
        border-color: var(--border-strong);
        background: var(--bg-card);
        color: var(--text-main);
      }

      .team-search {
        min-width: 0;
        display: flex;
        align-items: center;
        height: 42px;
        padding: 0 16px;
        border-radius: 8px;
        background: var(--bg-card);
        border: 0;
        color: var(--text-muted);
        font-size: 14px;
      }

      .team-search span {
        display: none;
      }

      .team-search input {
        min-width: 0;
        width: 100%;
        border: 0;
        outline: 0;
        appearance: none;
        background: transparent;
        color: var(--text-main);
        font: inherit;
      }

      .team-invite-btn {
        min-height: 38px;
        border-radius: 8px;
        white-space: nowrap;
      }

      .space-access-workbench {
        padding: 14px 12px;
        border-bottom: 1px solid var(--border-subtle);
        background: color-mix(in srgb, var(--bg-card) 58%, transparent);
      }

      .space-access-heading,
      .team-members-heading {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 10px;
      }

      .space-access-title {
        font-size: 13px;
        font-weight: 650;
        color: var(--text-main);
      }

      .space-access-subtitle {
        margin-top: 2px;
        font-size: 12px;
        color: var(--text-muted);
      }

      .space-invite-panel-inline {
        display: none !important;
      }

      .space-teams-panel {
        margin-top: 16px;
        padding-top: 14px;
        border-top: 1px solid var(--border-subtle);
      }

      .user-admin-form {
        margin-top: 8px;
        display: grid;
        grid-template-columns: minmax(180px, 0.9fr) minmax(180px, 0.9fr) 140px auto auto;
        gap: 8px;
        align-items: center;
      }

      .space-access-workbench > .user-admin-form {
        grid-template-columns: minmax(220px, 1fr) minmax(170px, 0.45fr) auto auto;
        margin-bottom: 10px !important;
      }

      .space-access-workbench > .team-form {
        grid-template-columns: minmax(180px, 0.5fr) minmax(240px, 1fr) auto auto;
      }

      .user-admin-projects {
        margin: 10px 12px 0;
        display: flex;
        flex-direction: column;
        gap: 8px;
      }

      .user-admin-projects[hidden] {
        display: none;
      }

      .user-admin-project-list {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
      }

      .user-admin-project-chip {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-height: 34px;
        padding: 5px 7px;
        border-radius: 8px;
        border: 1px solid var(--border-subtle);
        background: var(--bg-card);
        font-size: 12px;
        color: var(--text-main);
      }

      .space-access-workbench .user-admin-project-chip {
        min-width: 148px;
        justify-content: space-between;
      }

      .space-access-workbench .user-admin-project-chip select {
        width: 116px;
        min-height: 30px;
        padding: 5px 7px;
        border-radius: 7px;
      }

      #spaceRolePermissionsList {
        display: none;
      }

      .user-admin-project-chip input {
        margin: 0;
      }

      .user-admin-row {
        display: contents;
      }

      .space-role-list {
        display: grid;
        gap: 6px;
        margin-top: 10px;
      }

      .space-role-row {
        display: grid;
        grid-template-columns: minmax(170px, 0.8fr) minmax(260px, 1.4fr) auto;
        gap: 10px;
        align-items: center;
        min-height: 48px;
        padding: 8px 10px;
        border-radius: 8px;
        border: 1px solid var(--border-subtle);
        background: var(--bg-card);
      }

      .space-role-main,
      .team-member-main {
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 10px;
      }

      .space-role-icon,
      .team-member-avatar {
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        background: var(--surface-muted);
        color: var(--text-main);
        font-weight: 650;
        font-size: 12px;
        overflow: hidden;
      }

      .team-member-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
      }

      .space-role-name,
      .team-member-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: var(--text-main);
        font-size: 13px;
      }

      .space-role-meta,
      .team-member-meta {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: var(--text-muted);
        font-size: 12px;
      }

      .space-role-access,
      .team-access-badges {
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 5px;
        flex-wrap: wrap;
      }

      .access-badge {
        min-width: 26px;
        height: 26px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 7px;
        border: 1px solid var(--border-subtle);
        background: var(--surface-muted);
        color: var(--text-muted);
        font-size: 10px;
        font-weight: 650;
        line-height: 1;
      }

      .access-badge.view {
        color: #6b7cff;
        background: rgba(107, 124, 255, 0.12);
        border-color: rgba(107, 124, 255, 0.34);
      }

      .access-badge.work {
        color: #28a6f6;
        background: rgba(40, 166, 246, 0.12);
        border-color: rgba(40, 166, 246, 0.34);
      }

      .access-badge.full,
      .access-badge.admin {
        color: #ff5d7d;
        background: rgba(255, 93, 125, 0.12);
        border-color: rgba(255, 93, 125, 0.34);
      }

      .team-members-heading {
        padding: 14px 12px 6px;
        margin-bottom: 0;
      }

      .team-member-editor {
        margin: 0 12px 12px;
        padding: 10px;
        border-radius: 8px;
        border: 1px solid var(--border-subtle);
        background: var(--surface-muted);
      }

      .user-admin-panel:not(.member-editor-open) .team-member-editor,
      .user-admin-panel:not(.member-editor-open) .user-admin-projects,
      .user-admin-panel:not(.member-editor-open) #userAdminHint,
      .user-admin-panel:not(.member-editor-open) #userAdminStatus {
        display: none;
      }

      .team-table {
        display: grid;
        grid-template-columns: minmax(220px, 1.2fr) minmax(190px, 1fr) minmax(120px, 0.55fr) minmax(150px, 0.7fr) minmax(150px, 0.7fr) auto;
        overflow-x: auto;
      }

      .team-table-head,
      .team-table-cell {
        min-height: 54px;
        display: flex;
        align-items: center;
        min-width: 0;
        padding: 9px 12px;
        border-top: 1px solid var(--border-subtle);
        color: var(--text-muted);
        font-size: 12px;
      }

      .team-table-head {
        min-height: 38px;
        background: var(--surface-muted);
        color: var(--text-main);
        font-weight: 650;
      }

      .team-table-cell {
        background: color-mix(in srgb, var(--bg-card) 78%, transparent);
      }

      .team-table-actions {
        justify-content: flex-end;
        gap: 6px;
        white-space: nowrap;
      }

      .user-admin-role {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 5px 8px;
        border-radius: 7px;
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        border: 1px solid transparent;
      }

      .user-admin-role.admin {
        color: var(--accent);
        background: var(--accent-soft);
        border-color: var(--accent-strong);
      }

      .user-admin-role.viewer {
        color: var(--accent-secondary);
        background: var(--accent-secondary-soft);
        border-color: var(--accent-secondary-strong);
      }

      .user-admin-role.guest {
        color: var(--text-muted);
        background: var(--surface-muted);
        border-color: var(--border-subtle);
      }

      .space-invite-modal {
        display: grid;
        gap: 14px;
      }

      .space-invite-link-row,
      .space-invite-email-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(180px, 0.55fr);
        gap: 10px;
      }

      .space-invite-result {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        align-items: center;
        padding: 10px;
        border-radius: 8px;
        background: var(--surface-muted);
        border: 1px solid var(--border-subtle);
      }

      .space-invite-url {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: var(--text-main);
        font-size: 13px;
      }

      .space-invite-history {
        display: grid;
        gap: 6px;
      }

      .legacy-nav-group {
        margin-top: 12px;
        display: flex;
        flex-direction: column;
        gap: 8px;
      }

      #legacyNavList {
        display: flex;
        flex-direction: column;
        gap: 6px;
      }

      #legacyNavList .nav-item,
      #legacyNavList .nav-item:active {
        cursor: pointer;
      }

      .legacy-section-panel {
        margin-top: 14px;
        padding: 12px;
        border-radius: 18px;
        border: 1px dashed var(--border-strong);
        background: var(--panel-secondary-gradient);
      }

      .legacy-section-list {
        margin-top: 10px;
        display: flex;
        flex-direction: column;
        gap: 8px;
      }

      .legacy-section-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 12px;
        border-radius: 14px;
        border: 1px solid var(--border-subtle);
        background: var(--bg-card);
      }

      .legacy-section-row-main {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 3px;
      }

      .legacy-section-row-title {
        font-size: 13px;
        font-weight: 600;
        color: var(--text-main);
      }

      .legacy-section-row-meta {
        font-size: 11px;
        line-height: 1.35;
        color: var(--text-muted);
      }

      @media (max-width: 1180px) {
        .team-command-bar {
          grid-template-columns: 1fr;
        }

        .project-admin-form {
          grid-template-columns: 1fr;
        }

        .project-admin-row {
          grid-template-columns: 1fr;
        }

        .user-admin-form {
          grid-template-columns: 1fr;
        }

        .space-access-workbench > .user-admin-form,
        .space-access-workbench > .team-form,
        .space-role-row,
        .space-invite-link-row,
        .space-invite-email-row {
          grid-template-columns: 1fr;
        }

        .team-table {
          grid-template-columns: minmax(210px, 1.2fr) minmax(180px, 1fr) minmax(110px, 0.7fr) minmax(150px, 0.9fr) minmax(120px, 0.7fr) minmax(150px, auto);
        }

        .project-admin-actions {
          justify-content: flex-start;
        }
      }

      @media (max-width: 900px) {
        body {
          flex-direction: column;
        }

        .sidebar {
          width: 100%;
          flex-basis: auto;
          height: auto;
          position: static;
          border-right: none;
          border-bottom: 1px solid var(--sidebar-border);
          overflow: visible;
        }

        .sidebar-resizer {
          display: none;
        }
      }

      .auth-overlay {
        position: fixed;
        inset: 0;
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
        background: var(--overlay-bg);
        backdrop-filter: blur(8px);
      }

      .auth-overlay[hidden] {
        display: none;
      }

      .auth-card {
        width: min(460px, 100%);
        padding: 28px 28px 24px;
        border-radius: 28px;
        background: var(--surface-frost);
        border: 1px solid var(--badge-border);
        box-shadow: var(--shadow-deep);
      }

      .auth-title {
        font-size: 26px;
        font-weight: 700;
        line-height: 1.15;
        margin-bottom: 10px;
        letter-spacing: -0.03em;
      }

      .auth-subtitle {
        font-size: 14px;
        color: var(--text-muted);
        line-height: 1.55;
        margin-bottom: 20px;
      }

      .auth-form {
        display: flex;
        flex-direction: column;
        gap: 14px;
      }

      .auth-providers {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: 18px;
      }

      .auth-providers-divider {
        display: flex;
        align-items: center;
        gap: 12px;
        color: var(--text-muted);
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.08em;
      }

      .auth-providers-divider::before,
      .auth-providers-divider::after {
        content: '';
        flex: 1 1 auto;
        height: 1px;
        background: var(--border-subtle);
      }

      .auth-providers-divider span {
        white-space: nowrap;
      }

      .auth-provider-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 14px;
        width: min(360px, 100%);
        max-width: 100%;
        min-height: 56px;
        margin: 0 auto;
        padding: 12px 22px;
        border-radius: 18px;
        border: 1px solid var(--border-strong);
        background: var(--bg-card);
        color: var(--text-main);
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition:
          border-color 0.18s ease,
          transform 0.18s ease,
          box-shadow 0.18s ease,
          background 0.18s ease;
      }

      .auth-provider-btn:hover,
      .auth-provider-btn:focus-visible {
        border-color: var(--accent-secondary);
        box-shadow: 0 0 0 4px var(--focus-ring);
        transform: translateY(-1px);
      }

      .auth-provider-btn-text {
        white-space: nowrap;
      }

      .auth-provider-btn--yandex {
        border: none;
        background: #111216;
        color: #ffffff;
        box-shadow:
          0 16px 32px rgba(17, 18, 22, 0.16),
          0 4px 12px rgba(17, 18, 22, 0.12);
      }

      .auth-provider-btn--yandex:hover,
      .auth-provider-btn--yandex:focus-visible {
        border-color: transparent;
        background: #1b1d23;
        box-shadow:
          0 0 0 4px rgba(252, 63, 29, 0.12),
          0 18px 34px rgba(17, 18, 22, 0.2);
      }

      .auth-provider-btn-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
      }

      .auth-provider-btn-icon--yandex {
        width: 32px;
        height: 32px;
        border-radius: 999px;
        background: #fc3f1d;
        color: #ffffff;
        font-size: 21px;
        font-weight: 700;
        line-height: 1;
      }

      .auth-telegram-wrap {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: min(360px, 100%);
        max-width: 100%;
        min-height: 68px;
        margin: 0 auto;
        padding: 6px 0;
        border: none;
        background: transparent;
        overflow: visible;
      }

      .auth-telegram-widget {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 68px;
        overflow: visible;
      }

      .auth-telegram-widget iframe {
        transform: scale(1.18);
        transform-origin: center center;
      }

      .auth-connections-list {
        display: flex;
        flex-direction: column;
        gap: 12px;
      }

      .settings-shell {
        display: grid;
        grid-template-columns: 260px minmax(0, 1fr);
        gap: 18px;
        align-items: start;
      }

      .settings-sidebar {
        position: sticky;
        top: 18px;
        display: flex;
        flex-direction: column;
        gap: 14px;
      }

      .settings-sidebar-header {
        display: flex;
        flex-direction: column;
        gap: 4px;
      }

      .settings-sidebar-title {
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--text-muted);
      }

      .settings-sidebar-subtitle {
        font-size: 12px;
        line-height: 1.5;
        color: var(--text-muted);
      }

      .settings-sidebar-subtitle:empty {
        display: none;
      }

      .settings-category-nav {
        display: flex;
        flex-direction: column;
        gap: 8px;
      }

      .settings-category-btn {
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        min-height: 46px;
        padding: 11px 14px;
        border-radius: 16px;
        border: 1px solid var(--border-subtle);
        background: var(--panel-bg);
        color: var(--text-main);
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition:
          border-color 0.2s ease,
          background 0.2s ease,
          transform 0.2s ease,
          box-shadow 0.2s ease;
      }

      .settings-category-btn:hover,
      .settings-category-btn:focus-visible {
        border-color: var(--accent-color);
        background: var(--surface-muted);
        transform: translateY(-1px);
      }

      .settings-category-btn.active {
        border-color: rgba(37, 99, 235, 0.22);
        background: rgba(37, 99, 235, 0.08);
        color: #1d4ed8;
        box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
      }

      .settings-content {
        min-width: 0;
        display: flex;
        flex-direction: column;
      }

      #settingsSection > .panel {
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
      }

      #settingsSection > .panel > .panel-header,
      #settingsSection .settings-group-header {
        display: none;
      }

      .settings-group {
        display: flex;
        flex-direction: column;
        gap: 14px;
      }

      #settingsSection .settings-group {
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
      }

      .settings-pane[hidden] {
        display: none !important;
      }

      .settings-group-header {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 2px 2px 0;
      }

      .settings-group-eyebrow {
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--text-muted);
      }

      .settings-group-title {
        font-size: 24px;
        line-height: 1.1;
        font-weight: 700;
        color: var(--text-main);
      }

      .settings-group-subtitle {
        font-size: 13px;
        line-height: 1.5;
        color: var(--text-muted);
      }

      .profile-settings-form {
        display: flex;
        flex-direction: column;
        gap: 16px;
        width: 100%;
        max-width: none;
      }

      .profile-cover-card,
      .profile-settings-section {
        border-radius: 8px;
        border: 1px solid var(--border-subtle);
        background: color-mix(in srgb, var(--bg-card) 92%, transparent);
      }

      .profile-cover-card {
        position: relative;
        overflow: hidden;
        min-height: 210px;
        padding: 26px;
        display: flex;
        align-items: flex-start;
        gap: 28px;
        color: #f8fafc;
        background-color: #222426;
        background-position: center;
        background-size: cover;
      }

      .profile-cover-card::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, rgba(12, 14, 18, 0.76), rgba(12, 14, 18, 0.28));
        pointer-events: none;
      }

      .profile-avatar-preview {
        position: relative;
        z-index: 1;
        width: 112px;
        height: 112px;
        padding: 0;
        border: 0;
        border-radius: 18px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.08);
        color: #f8fafc;
        font-size: 42px;
        line-height: 1;
        cursor: pointer;
        overflow: hidden;
      }

      .profile-avatar-preview:hover,
      .profile-avatar-preview:focus-visible {
        outline: 2px solid rgba(248, 250, 252, 0.72);
        outline-offset: 3px;
      }

      .profile-avatar-preview img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
      }

      .profile-cover-settings-btn {
        position: absolute;
        z-index: 2;
        top: 18px;
        right: 18px;
        width: 40px;
        height: 40px;
        border: 0;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.12);
        color: #f8fafc;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
      }

      .profile-cover-settings-btn:hover,
      .profile-cover-settings-btn:focus-visible {
        background: rgba(255, 255, 255, 0.2);
      }

      .profile-cover-settings-btn svg {
        width: 20px;
        height: 20px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
      }

      .profile-cover-main {
        position: relative;
        z-index: 1;
        align-self: flex-end;
        min-width: 0;
      }

      .profile-cover-action,
      .profile-cover-meta {
        color: rgba(248, 250, 252, 0.72);
        font-size: 14px;
      }

      .profile-cover-name {
        margin: 12px 0 24px;
        font-size: 30px;
        line-height: 1.15;
        font-weight: 650;
        color: #f8fafc;
      }

      .profile-settings-section {
        padding: 22px 24px;
      }

      .profile-settings-title {
        margin-bottom: 18px;
        color: var(--text-main);
        font-size: 22px;
        font-weight: 650;
      }

      .profile-form-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px 16px;
      }

      .profile-field {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 7px;
        color: var(--text-main);
        font-size: 13px;
        font-weight: 600;
      }

      .profile-field-wide {
        grid-column: 1 / -1;
      }

      .profile-field textarea.admin-input {
        min-height: 96px;
        resize: vertical;
      }

      .profile-weekdays {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
      }

      .profile-weekdays label {
        min-width: 44px;
        min-height: 36px;
        border-radius: 8px;
        background: var(--surface-muted);
        color: var(--text-muted);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
      }

      .profile-weekdays input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
      }

      .profile-weekdays label:has(input:checked) {
        background: rgba(37, 99, 235, 0.14);
        color: #2563eb;
      }

      .profile-actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 12px;
        padding-bottom: 10px;
      }

      .profile-actions .status-message {
        margin-right: auto;
      }

      @media (max-width: 760px) {
        .profile-cover-card {
          flex-direction: column;
          min-height: 240px;
        }

        .profile-cover-main {
          align-self: stretch;
        }

        .profile-form-grid {
          grid-template-columns: 1fr;
        }
      }

      .auth-connection-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 16px 18px;
        border-radius: 20px;
        background: var(--panel-bg);
        border: 1px solid var(--border-subtle);
      }

      .auth-connection-main {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
      }

      .auth-connection-title {
        font-size: 15px;
        font-weight: 600;
        color: var(--text-main);
      }

      .auth-connection-meta {
        font-size: 12px;
        line-height: 1.5;
        color: var(--text-muted);
      }

      .auth-connection-actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex: 0 0 auto;
        min-width: 180px;
      }

      .auth-connection-action-stack {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 10px;
      }

      .auth-connection-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 38px;
        padding: 8px 14px;
        border-radius: 999px;
        background: var(--badge-bg);
        border: 1px solid var(--badge-border);
        color: var(--text-main);
        font-size: 12px;
        font-weight: 600;
      }

      .auth-connection-badge.success {
        background: rgba(22, 163, 74, 0.1);
        border-color: rgba(22, 163, 74, 0.18);
        color: #15803d;
      }

      .auth-connection-badge.muted {
        background: var(--surface-muted);
        border-color: var(--border-subtle);
        color: var(--text-muted);
      }

      .auth-connection-yandex-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        min-width: 220px;
        min-height: 48px;
        padding: 10px 18px;
        border: none;
        border-radius: 16px;
        background: #111216;
        color: #ffffff;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        box-shadow:
          0 12px 24px rgba(17, 18, 22, 0.14),
          0 4px 10px rgba(17, 18, 22, 0.1);
      }

      .auth-connection-yandex-btn:hover,
      .auth-connection-yandex-btn:focus-visible {
        background: #1b1d23;
        box-shadow:
          0 0 0 4px rgba(252, 63, 29, 0.12),
          0 16px 26px rgba(17, 18, 22, 0.16);
      }

      .auth-connection-yandex-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        border-radius: 999px;
        background: #fc3f1d;
        color: #ffffff;
        font-size: 19px;
        font-weight: 700;
        line-height: 1;
      }

      .auth-connection-secondary-btn,
      .auth-connection-telegram-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 10px 16px;
        border-radius: 14px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition:
          transform 0.2s ease,
          box-shadow 0.2s ease,
          background 0.2s ease,
          border-color 0.2s ease;
      }

      .auth-connection-secondary-btn {
        border: 1px solid var(--border-subtle);
        background: var(--panel-bg);
        color: var(--text-main);
      }

      .auth-connection-secondary-btn:hover,
      .auth-connection-secondary-btn:focus-visible {
        border-color: var(--border-strong);
        background: var(--surface-muted);
        transform: translateY(-1px);
      }

      .auth-connection-secondary-btn.danger {
        color: #b91c1c;
        border-color: rgba(185, 28, 28, 0.18);
        background: rgba(185, 28, 28, 0.04);
      }

      .auth-connection-secondary-btn.danger:hover,
      .auth-connection-secondary-btn.danger:focus-visible {
        background: rgba(185, 28, 28, 0.08);
        box-shadow: 0 8px 16px rgba(185, 28, 28, 0.08);
      }

      .auth-connection-telegram-btn {
        gap: 10px;
        min-width: 240px;
        border: none;
        background: linear-gradient(135deg, #2aa7eb 0%, #1a8cd8 100%);
        color: #ffffff;
        box-shadow:
          0 12px 24px rgba(30, 136, 229, 0.18),
          0 4px 10px rgba(30, 136, 229, 0.14);
      }

      .auth-connection-telegram-btn:hover,
      .auth-connection-telegram-btn:focus-visible {
        transform: translateY(-1px);
        box-shadow:
          0 16px 28px rgba(30, 136, 229, 0.2),
          0 0 0 4px rgba(42, 167, 235, 0.14);
      }

      .auth-connection-popup-note {
        font-size: 12px;
        line-height: 1.5;
        color: var(--text-muted);
        max-width: 320px;
        text-align: right;
      }

      @media (max-width: 1100px) {
        .settings-shell {
          grid-template-columns: 1fr;
        }

        .settings-sidebar {
          position: static;
        }

        .settings-category-nav {
          flex-direction: row;
          flex-wrap: wrap;
        }

        .settings-category-btn {
          width: auto;
          justify-content: center;
        }
      }

      @media (max-width: 900px) {
        .auth-connection-row {
          flex-direction: column;
          align-items: stretch;
        }

        .auth-connection-actions {
          justify-content: flex-start;
          min-width: 0;
        }

        .auth-connection-action-stack {
          align-items: stretch;
        }

        .auth-connection-yandex-btn,
        .auth-connection-telegram-btn,
        .auth-connection-secondary-btn {
          width: 100%;
        }

        .auth-connection-popup-note {
          max-width: none;
          text-align: left;
        }

        .settings-group-title {
          font-size: 21px;
        }
      }

      .auth-form label {
        display: flex;
        flex-direction: column;
        gap: 6px;
        font-size: 12px;
        color: var(--text-muted);
      }

      .auth-mode-switch {
        display: inline-flex;
        gap: 6px;
        padding: 4px;
        border-radius: 999px;
        background: var(--panel-bg);
        border: 1px solid var(--border-subtle);
        margin-bottom: 14px;
      }

      .auth-mode-btn {
        border: none;
        background: transparent;
        color: var(--text-muted);
        padding: 8px 14px;
        border-radius: 999px;
        cursor: pointer;
        font-size: 13px;
        font-weight: 600;
        transition: background 0.15s ease, color 0.15s ease;
      }

      .auth-mode-btn.active {
        background: var(--accent-secondary-soft);
        color: var(--text-main);
      }

      .crm-dialog-overlay {
        position: fixed;
        inset: 0;
        z-index: 1100;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
        background: var(--overlay-bg);
        backdrop-filter: blur(10px);
      }

      .crm-dialog-overlay[hidden] {
        display: none;
      }

      .crm-dialog-card {
        width: min(760px, 100%);
        max-height: min(88vh, 920px);
        overflow: auto;
        padding: 22px;
        border-radius: 24px;
        background: var(--surface-frost);
        border: 1px solid var(--badge-border);
        box-shadow: var(--shadow-soft);
      }

      .crm-dialog-form {
        display: flex;
        flex-direction: column;
        gap: 14px;
      }

      .crm-modal-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
      }

      .crm-modal-grid.single {
        grid-template-columns: 1fr;
      }

      .crm-modal-field {
        display: flex;
        flex-direction: column;
        gap: 6px;
        font-size: 12px;
        color: var(--text-muted);
      }

      .crm-modal-field.full {
        grid-column: 1 / -1;
      }

      .crm-modal-actions {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        padding-top: 6px;
      }

      .crm-modal-info {
        padding: 12px 14px;
        border-radius: 14px;
        background: var(--panel-bg);
        border: 1px dashed var(--border-strong);
        color: var(--text-muted);
        font-size: 12px;
      }

      .crm-checkbox-row {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 40px;
        padding: 0 2px;
        color: var(--text-main);
      }

      .crm-checkbox-row input {
        margin: 0;
      }

      @media (max-width: 760px) {
        .crm-dialog-card {
          padding: 18px;
        }

        .crm-modal-grid {
          grid-template-columns: 1fr;
        }

        .crm-modal-actions {
          flex-direction: column-reverse;
        }

        .crm-project-member-add,
        .crm-project-member-row,
        .crm-project-visibility-switch {
          grid-template-columns: 1fr;
        }

        .widget-card.widget-wide {
          grid-column: span 1;
        }
      }

      .auth-form input {
        border-radius: 16px;
        border: 1px solid var(--border-strong);
        background: var(--bg-card);
        color: var(--text-main);
        padding: 12px 14px;
        font-size: 14px;
        transition:
          border-color 0.18s ease,
          box-shadow 0.18s ease,
          background 0.18s ease;
      }

      .auth-form input:focus {
        outline: none;
        border-color: var(--accent-secondary);
        box-shadow: 0 0 0 4px var(--focus-ring);
      }

      .auth-submit {
        margin-top: 8px;
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
        font-size: 14px;
        font-weight: 600;
      }

      .auth-form-links {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
      }

      .auth-link-btn {
        border: none;
        background: transparent;
        padding: 0;
        color: var(--accent-secondary);
        font-size: 12px;
        cursor: pointer;
      }

      .auth-link-btn:hover,
      .auth-link-btn:focus-visible {
        color: var(--button-accent-hover);
      }

      .auth-info {
        min-height: 18px;
        margin-top: -2px;
        font-size: 12px;
        color: var(--accent-secondary);
      }

      .auth-error {
        min-height: 18px;
        margin-top: -2px;
        font-size: 12px;
        color: #b91c1c;
      }

      .cmp-table th,
      .cmp-table td {
        padding: 4px 6px;
        border-bottom: 1px solid var(--border-subtle);
      }
      .cmp-table th {
        font-size: 11px;
        text-align: left;
        color: var(--text-muted);
      }
      .cmp-table td {
        font-size: 12px;
      }
      .cmp-main-row {
        cursor: pointer;
      }
      .cmp-main-row:hover {
        background: var(--table-row-hover);
      }

      .proj-filters {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        align-items: center;
        font-size: 13px;
        color: var(--text-muted);
      }

      .proj-filters input,
      .proj-filters select {
        padding: 6px 10px;
        border-radius: 12px;
        border: 1px solid var(--border-strong);
        background: var(--bg-card);
        color: var(--text-main);
        min-width: 110px;
        max-width: 190px;
      }

      .proj-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 12px;
      }

      .proj-table th,
      .proj-table td {
        padding: 10px;
        border-bottom: 1px solid var(--border-subtle);
        text-align: left;
      }

      .proj-table th {
        color: var(--text-muted);
        font-weight: 500;
      }

      .proj-summary {
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
        margin-top: 10px;
        font-size: 12px;
      }

      .proj-summary .badge {
        background: var(--accent-soft);
        color: var(--accent);
        border-color: var(--accent-strong);
      }

      .stat-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 12px;
        margin-top: 12px;
      }

      .stat-card {
        padding: 14px;
        border-radius: var(--radius-xl);
        background: var(--bg-card);
        border: 1px solid var(--border-subtle);
        box-shadow: var(--shadow-soft);
      }

      .stat-card .label {
        font-size: 12px;
        color: var(--text-muted);
        margin-bottom: 6px;
      }

      .stat-card .value {
        font-size: 20px;
        font-weight: 600;
      }

      .stat-card .hint {
        font-size: 11px;
        color: var(--text-muted);
        margin-top: 4px;
      }

      .section-columns {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 12px;
        align-items: flex-start;
      }

      .planfact-summary {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
        gap: 12px;
        margin-top: 12px;
      }

      .planfact-card {
        padding: 14px;
        border-radius: 16px;
        background: var(--bg-card);
        border: 1px solid var(--border-subtle);
        box-shadow: var(--shadow-soft);
      }

      .planfact-card h3 {
        font-size: 13px;
        font-weight: 600;
        margin-bottom: 8px;
      }

      .planfact-kpi {
        display: flex;
        flex-direction: column;
        gap: 4px;
      }

      .planfact-kpi .value {
        font-size: 20px;
        font-weight: 600;
      }

      .planfact-kpi .label {
        font-size: 11px;
        color: var(--text-muted);
      }

      .planfact-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 12px;
        margin-top: 12px;
      }

      .planfact-charts {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 12px;
        margin-top: 12px;
      }

      .planfact-mini-charts {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 12px;
        margin-top: 12px;
      }

      .planfact-mini-chart-card {
        min-height: 220px;
        display: flex;
        flex-direction: column;
        gap: 8px;
      }

      .planfact-mini-chart-wrapper {
        flex: 1;
        min-height: 160px;
        position: relative;
      }

      .planfact-chart-card {
        min-height: 320px;
        display: flex;
        flex-direction: column;
        gap: 8px;
      }

      .planfact-chart-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 13px;
        font-weight: 600;
      }

      .planfact-chart-wrapper {
        flex: 1;
        min-height: 220px;
        position: relative;
      }

      .planfact-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 12px;
      }

      .planfact-table th,
      .planfact-table td {
        padding: 6px 8px;
        border-bottom: 1px solid var(--border-subtle);
        text-align: left;
      }

      .planfact-table th {
        font-size: 11px;
        color: var(--text-muted);
        font-weight: 500;
      }

      .planfact-table tfoot td {
        font-weight: 600;
      }

      .planfact-muted {
        font-size: 12px;
        color: var(--text-muted);
      }

      .report-blocks {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 12px;
        margin-top: 12px;
      }

      .report-block {
        background: var(--bg-card);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-xl);
        padding: 12px;
        box-shadow: var(--shadow-soft);
        font-size: 12px;
        line-height: 1.5;
      }

      .pill {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 10px 14px;
        background: var(--accent-soft);
        border: 1px solid var(--accent-strong);
        color: var(--accent);
        border-radius: 999px;
        font-size: 14px;
        font-weight: 700;
        width: 100%;
        text-align: center;
        margin: 0 0 8px 0;
      }

      .toggle-bar {
        display: flex;
        justify-content: space-between;
        gap: 8px;
        margin: 8px 0 10px;
        flex-wrap: wrap;
      }

      .toggle-group {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
      }

      .toggle-label {
        font-size: 12px;
        color: var(--text-muted);
      }

      .chip-toggle {
        border: 1px solid var(--border-subtle);
        background: var(--bg-card);
        color: var(--text-main);
        padding: 6px 10px;
        border-radius: 999px;
        cursor: pointer;
        font-size: 12px;
        transition: all 0.15s ease;
      }

      .chip-toggle.active {
        background: var(--button-accent-soft);
        border-color: var(--button-accent-strong);
        color: var(--button-accent);
        box-shadow: var(--button-shadow);
      }

      .crm-stack {
        display: flex;
        flex-direction: column;
        gap: 14px;
      }

      .crm-dashboard-grid,
      .crm-finance-summary {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 12px;
      }

      .crm-section-grid {
        display: grid;
        grid-template-columns: 1.05fr 0.95fr;
        gap: 12px;
        align-items: start;
      }

      .crm-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
      }

      .crm-list-item,
      .crm-entry-row,
      .crm-category-row {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 14px;
        border: 1px solid var(--border-subtle);
        background: var(--bg-card);
      }

      .crm-entry-row,
      .crm-category-row {
        padding: 8px 10px;
      }

      .crm-list-title {
        font-size: 13px;
        font-weight: 600;
      }

      .crm-list-meta,
      .crm-task-meta,
      .crm-muted {
        font-size: 11px;
        color: var(--text-muted);
      }

      .crm-empty {
        padding: 14px;
        border: 1px dashed var(--border-strong);
        border-radius: 16px;
        color: var(--text-muted);
        font-size: 12px;
        background: var(--panel-bg);
      }

      .crm-news-editor {
        display: grid;
        gap: 10px;
        padding: 14px;
        border: 1px dashed var(--border-strong);
        border-radius: 18px;
        background: var(--panel-accent-gradient);
      }

      .crm-news-textarea {
        min-height: 160px;
        resize: vertical;
        line-height: 1.5;
      }

      .crm-news-pin-switch {
        width: fit-content;
      }

      .crm-news-list {
        display: grid;
        gap: 12px;
      }

      .crm-news-profile-card {
        display: grid;
        gap: 16px;
        padding: 18px;
        border-radius: 22px;
        border: 1px solid rgba(59, 130, 246, 0.14);
        background:
          radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 38%),
          var(--bg-card);
        box-shadow: var(--shadow-soft);
      }

      .crm-news-profile-head {
        display: flex;
        align-items: center;
        gap: 14px;
      }

      .crm-news-profile-avatar {
        width: 54px;
        height: 54px;
        border-radius: 18px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 22px;
        font-weight: 700;
        color: #1d4ed8;
        background: rgba(59, 130, 246, 0.12);
        border: 1px solid rgba(59, 130, 246, 0.18);
        overflow: hidden;
      }

      .crm-news-profile-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
      }

      .crm-news-profile-main {
        display: grid;
        gap: 4px;
      }

      .crm-news-profile-title {
        font-size: 12px;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--text-muted);
      }

      .crm-news-profile-name {
        font-size: 24px;
        font-weight: 700;
        line-height: 1.1;
        color: var(--text-main);
      }

      .crm-news-profile-meta {
        font-size: 13px;
        color: var(--text-muted);
      }

      .crm-news-profile-stats {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
      }

      .crm-news-profile-stat {
        display: grid;
        gap: 4px;
        padding: 12px 14px;
        border-radius: 16px;
        border: 1px solid var(--border-subtle);
        background: color-mix(in srgb, var(--bg-card) 82%, var(--surface-muted));
      }

      .crm-news-profile-stat-value {
        font-size: 22px;
        font-weight: 700;
        color: var(--text-main);
      }

      .crm-news-profile-stat-label {
        font-size: 12px;
        color: var(--text-muted);
      }

      .crm-news-shared-widget {
        display: grid;
        gap: 16px;
        padding: 18px;
        border-radius: 22px;
        border: 1px solid var(--border-subtle);
        background: var(--bg-card);
        box-shadow: var(--soft-shadow);
      }

      .crm-news-important-list {
        display: grid;
        gap: 12px;
      }

      .crm-news-shared-widget.published {
        border-color: rgba(59, 130, 246, 0.18);
        background:
          radial-gradient(circle at top left, rgba(59, 130, 246, 0.1), transparent 42%),
          var(--bg-card);
      }

      .crm-news-shared-widget.draft,
      .crm-news-shared-widget.empty {
        border-style: dashed;
        background: var(--panel-bg);
      }

      .crm-news-shared-widget-head {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        align-items: flex-start;
      }

      .crm-news-shared-widget-title-row {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
      }

      .crm-news-shared-widget-title {
        font-size: 24px;
        font-weight: 700;
        line-height: 1.1;
      }

      .crm-news-shared-widget-meta {
        margin-top: 6px;
        font-size: 12px;
        color: var(--text-muted);
      }

      .crm-news-shared-widget-body {
        display: grid;
        grid-template-columns: 150px minmax(0, 1fr);
        gap: 16px;
        align-items: start;
      }

      .crm-news-shared-widget-logo {
        min-height: 124px;
        border-radius: 18px;
        border: 1px dashed var(--border-strong);
        background: rgba(148, 163, 184, 0.08);
        color: var(--text-muted);
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 16px;
        line-height: 1.4;
      }

      .crm-news-shared-widget-content {
        display: grid;
        gap: 10px;
        font-size: 14px;
        line-height: 1.7;
        color: var(--text-main);
      }

      .crm-news-shared-widget-content h3 {
        margin: 0;
        font-size: 18px;
        line-height: 1.3;
      }

      .crm-news-card {
        display: grid;
        gap: 12px;
        padding: 16px;
        border-radius: 18px;
        border: 1px solid var(--border-subtle);
        background: var(--bg-card);
        box-shadow: var(--soft-shadow);
      }

      .crm-news-card.pinned {
        border-color: var(--accent-strong);
        background: var(--panel-accent-gradient);
      }

      .crm-news-card-head {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        align-items: flex-start;
      }

      .crm-news-card-title-row {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
      }

      .crm-news-card-title {
        margin: 0;
        font-size: 16px;
        line-height: 1.3;
      }

      .crm-news-card-meta {
        margin-top: 6px;
        font-size: 11px;
        color: var(--text-muted);
      }

      .crm-news-card-body {
        font-size: 13px;
        line-height: 1.65;
        color: var(--text-main);
        white-space: normal;
      }

      .crm-news-badge {
        display: inline-flex;
        align-items: center;
        padding: 4px 8px;
        border-radius: 999px;
        border: 1px solid var(--accent-strong);
        background: var(--accent-soft);
        color: var(--accent);
        font-size: 10px;
        letter-spacing: 0.04em;
        text-transform: uppercase;
      }

      .crm-news-badge.draft {
        border-color: rgba(245, 158, 11, 0.28);
        background: rgba(245, 158, 11, 0.12);
        color: #b45309;
      }

      .crm-news-task-panel {
        min-height: 100%;
      }

      .crm-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 4px 8px;
        border-radius: 999px;
        font-size: 10px;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: var(--button-accent);
        background: var(--button-accent-soft);
        border: 1px solid var(--button-accent-strong);
      }

      .crm-badge.expense {
        color: #b45309;
        background: rgba(245, 158, 11, 0.12);
        border-color: rgba(245, 158, 11, 0.28);
      }

      .crm-badge.tax {
        color: #0369a1;
        background: rgba(14, 165, 233, 0.12);
        border-color: rgba(14, 165, 233, 0.28);
      }

      .crm-badge.inactive {
        color: #64748b;
        background: rgba(148, 163, 184, 0.14);
        border-color: rgba(148, 163, 184, 0.3);
      }

      .crm-badge.done {
        color: #15803d;
        background: rgba(34, 197, 94, 0.12);
        border-color: rgba(34, 197, 94, 0.28);
      }

      .crm-badge.overdue {
        color: #b91c1c;
        background: rgba(239, 68, 68, 0.1);
        border-color: rgba(239, 68, 68, 0.24);
      }

      .crm-finance-toolbar,
      .crm-project-toolbar {
        margin-top: 8px;
        display: grid;
        grid-template-columns: minmax(220px, 1fr) 180px 130px minmax(220px, 1fr) auto;
        gap: 8px;
        align-items: center;
      }

      .crm-inline-form {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
        gap: 8px;
        align-items: center;
        margin-top: 10px;
      }

      .crm-inline-form.two-col {
        grid-template-columns: repeat(2, minmax(0, 1fr)) 120px auto;
      }

      .crm-inline-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }

      .crm-project-header-main {
        display: flex;
        flex-direction: column;
        gap: 8px;
      }

      .crm-project-header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
      }

      .crm-project-access-pill {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-height: 30px;
        padding: 0 12px;
        border-radius: 999px;
        border: 1px solid rgba(37, 99, 235, 0.18);
        background: rgba(37, 99, 235, 0.08);
        color: #1d4ed8;
        font-size: 12px;
        font-weight: 600;
      }

      .crm-project-access-pill.private {
        border-color: rgba(245, 158, 11, 0.22);
        background: rgba(245, 158, 11, 0.12);
        color: #b45309;
      }

      .crm-project-menu-trigger {
        width: 36px;
        height: 36px;
        border: 1px solid var(--border-subtle);
        border-radius: 12px;
        background: var(--panel-bg);
        color: var(--text-main);
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        line-height: 1;
        box-shadow: var(--brand-shadow);
      }

      .crm-project-menu-trigger:hover,
      .crm-project-menu-trigger:focus-visible {
        border-color: rgba(37, 99, 235, 0.2);
        background: rgba(37, 99, 235, 0.08);
      }

      .crm-section-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }

      .crm-finance-filters,
      .crm-finance-compare-controls {
        align-items: center;
        flex-wrap: wrap;
      }

      .crm-finance-filters select,
      .crm-finance-filters input,
      .crm-finance-compare-controls select {
        min-width: 140px;
      }

      .crm-workspaces,
      .crm-kanban-projects {
        display: flex;
        flex-direction: column;
        gap: 14px;
      }

      .crm-workspace-card,
      .crm-project-card,
      .crm-board-shell {
        border: 1px solid var(--border-subtle);
        border-radius: 18px;
        background: var(--bg-card);
        padding: 14px;
      }

      .crm-workspace-card {
        cursor: default;
      }

      .crm-workspace-card.dragging {
        opacity: 0.55;
      }

      .crm-workspace-header,
      .crm-project-header,
      .crm-board-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 12px;
      }

      .crm-workspace-heading {
        display: flex;
        align-items: flex-start;
        gap: 10px;
      }

      .crm-workspace-body[hidden] {
        display: none !important;
      }

      .crm-workspace-toggle {
        min-width: 32px;
        width: 32px;
        height: 32px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 15px;
        line-height: 1;
      }

      .crm-drag-handle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        border-radius: 10px;
        border: 1px solid var(--border-subtle);
        background: var(--panel-bg);
        color: var(--text-muted);
        font-size: 13px;
        line-height: 1;
        flex: 0 0 auto;
      }

      .crm-list-scroll {
        max-height: 340px;
        overflow: auto;
        padding-right: 4px;
      }

      .crm-project-menu-popover {
        position: fixed;
        top: 16px;
        left: 16px;
        width: min(320px, calc(100vw - 24px));
        padding: 10px;
        border: 1px solid var(--border-subtle);
        border-radius: 22px;
        background: var(--panel-surface, var(--bg-card));
        box-shadow: var(--brand-shadow);
        z-index: 4200;
      }

      .crm-project-menu-list {
        display: flex;
        flex-direction: column;
        gap: 4px;
      }

      .crm-project-menu-divider {
        height: 1px;
        background: var(--border-subtle);
        margin: 6px 2px;
      }

      .crm-project-menu-item {
        width: 100%;
        border: none;
        background: transparent;
        color: var(--text-main);
        border-radius: 14px;
        padding: 12px 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        text-align: left;
        cursor: pointer;
      }

      .crm-project-menu-item:hover,
      .crm-project-menu-item:focus-visible {
        background: rgba(37, 99, 235, 0.08);
      }

      .crm-project-menu-item.danger {
        color: #dc2626;
      }

      .crm-project-menu-item-main {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
        flex: 1 1 auto;
      }

      .crm-project-menu-item-title {
        font-size: 15px;
        font-weight: 600;
      }

      .crm-project-menu-item-meta {
        color: var(--text-muted);
        font-size: 12px;
      }

      .crm-project-members-editor {
        display: flex;
        flex-direction: column;
        gap: 14px;
      }

      .crm-project-access-note {
        padding: 10px 12px;
        border-radius: 14px;
        background: rgba(37, 99, 235, 0.06);
        color: var(--text-muted);
        font-size: 13px;
        line-height: 1.45;
      }

      .crm-project-visibility-switch {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 6px;
        border: 1px solid var(--border-subtle);
        border-radius: 18px;
        background: var(--panel-bg);
      }

      .crm-project-visibility-btn {
        min-height: 44px;
        border: none;
        border-radius: 14px;
        background: transparent;
        color: var(--text-muted);
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
      }

      .crm-project-visibility-btn.active {
        background: var(--bg-card);
        color: var(--text-main);
        box-shadow: var(--brand-shadow);
      }

      .crm-project-member-add {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        align-items: end;
      }

      .crm-project-member-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
      }

      .crm-project-member-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 170px auto;
        gap: 8px;
        align-items: center;
        padding: 10px 12px;
        border: 1px solid var(--border-subtle);
        border-radius: 16px;
        background: var(--bg-card);
      }

      .crm-project-member-main {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
      }

      .crm-project-member-name {
        font-size: 14px;
        font-weight: 600;
        color: var(--text-main);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .crm-project-member-meta {
        font-size: 12px;
        color: var(--text-muted);
      }

      .crm-project-member-remove {
        width: 34px;
        height: 34px;
        border: 1px solid rgba(220, 38, 38, 0.18);
        border-radius: 12px;
        background: rgba(220, 38, 38, 0.08);
        color: #dc2626;
        cursor: pointer;
      }

      .crm-project-member-empty {
        padding: 14px;
        border: 1px dashed var(--border-subtle);
        border-radius: 16px;
        color: var(--text-muted);
        text-align: center;
        font-size: 13px;
      }

      .crm-row-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 6px;
        margin-top: 8px;
      }

      .crm-row-amount {
        margin-top: 6px;
        font-weight: 600;
      }

      .crm-finance-rule-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 10px;
      }

      .crm-finance-rule-card {
        padding: 12px;
        border-radius: 14px;
        border: 1px solid var(--border-subtle);
        background: var(--panel-bg);
      }

      .crm-finance-rule-card.is-clickable {
        cursor: pointer;
        transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
      }

      .crm-finance-rule-card.is-clickable:hover {
        border-color: rgba(64, 86, 161, 0.22);
        box-shadow: 0 8px 18px rgba(64, 86, 161, 0.08);
      }

      .crm-finance-rule-card .panel-title {
        font-size: 13px;
      }

      .crm-finance-rule-card .value {
        font-size: 22px;
        font-weight: 700;
        line-height: 1.15;
      }

      .crm-finance-rule-card-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 10px;
      }

      .crm-finance-compare-chart {
        height: 210px;
        margin-top: 10px;
      }

      .crm-finance-compare-summary {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 12px;
      }

      .crm-finance-compare-card {
        border: 1px solid var(--border-subtle);
        border-radius: 18px;
        background: var(--panel-bg);
        padding: 14px;
      }

      .crm-finance-compare-card-title {
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 10px;
      }

      .crm-finance-compare-metrics {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
      }

      .crm-finance-compare-metric {
        display: flex;
        flex-direction: column;
        gap: 4px;
      }

      .crm-finance-compare-metric-label {
        font-size: 11px;
        color: var(--text-muted);
      }

      .crm-finance-compare-metric-value {
        font-size: 18px;
        font-weight: 700;
        line-height: 1.15;
      }

      .crm-finance-compare-delta-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
      }

      .crm-finance-compare-delta-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        align-items: center;
        padding: 10px 0;
        border-top: 1px dashed var(--border-subtle);
      }

      .crm-finance-compare-delta-row:first-child {
        border-top: none;
        padding-top: 0;
      }

      .crm-finance-compare-delta-title {
        font-size: 12px;
        font-weight: 600;
      }

      .crm-finance-compare-delta-meta {
        margin-top: 3px;
        font-size: 11px;
        color: var(--text-muted);
      }

      .crm-finance-compare-chip {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 106px;
        padding: 6px 10px;
        border-radius: 999px;
        border: 1px solid var(--border-strong);
        background: var(--bg-card);
        font-size: 11px;
        font-weight: 600;
        white-space: nowrap;
      }

      .crm-finance-compare-chip.positive {
        color: #15803d;
        background: rgba(34, 197, 94, 0.12);
        border-color: rgba(34, 197, 94, 0.26);
      }

      .crm-finance-compare-chip.negative {
        color: #b91c1c;
        background: rgba(239, 68, 68, 0.1);
        border-color: rgba(239, 68, 68, 0.22);
      }

      .crm-finance-compare-chip.neutral {
        color: var(--text-muted);
        background: var(--panel-bg);
      }

      .crm-board-columns {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        padding-bottom: 6px;
      }

      .crm-kanban-column,
      .crm-board-add-column {
        min-width: 280px;
        max-width: 280px;
        border: 1px solid var(--border-subtle);
        border-radius: 16px;
        background: var(--panel-bg);
        padding: 12px;
        display: flex;
        flex-direction: column;
        gap: 10px;
      }

      .crm-column-dropzone {
        min-height: 24px;
        display: flex;
        flex-direction: column;
        gap: 8px;
      }

      .crm-column-dropzone.crm-drop-target {
        border-radius: 12px;
        outline: 2px dashed var(--button-accent-strong);
        outline-offset: 2px;
      }

      .crm-task-card {
        border-radius: 14px;
        border: 1px solid var(--border-subtle);
        background: var(--bg-card);
        padding: 10px;
        display: flex;
        flex-direction: column;
        gap: 6px;
        cursor: grab;
      }

      .crm-task-card.dragging {
        opacity: 0.55;
      }

      .crm-task-title {
        font-size: 13px;
        font-weight: 600;
        line-height: 1.35;
      }

      .crm-task-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 10px;
      }

      .crm-task-form {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding-top: 6px;
        border-top: 1px dashed var(--border-subtle);
      }

      .crm-column-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
      }

      .crm-column-title {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 13px;
        font-weight: 600;
      }

      .crm-color-dot {
        width: 10px;
        height: 10px;
        border-radius: 999px;
        flex: 0 0 10px;
      }

      .crm-mini-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 12px;
      }

      @media (max-width: 1100px) {
        .crm-section-grid {
          grid-template-columns: 1fr;
        }

        .crm-news-shared-widget-body {
          grid-template-columns: 1fr;
        }

        .crm-finance-toolbar,
        .crm-project-toolbar,
        .crm-inline-form,
        .crm-inline-form.two-col {
          grid-template-columns: 1fr;
        }

        .crm-section-actions {
          width: 100%;
        }
      }

      /* Notion-inspired visual refresh layered on top of the existing UI. */
      :root {
        --bg: #f6f5f4;
        --bg-card: #ffffff;
        --bg-card-soft: #f6f5f4;
        --panel-bg: rgba(246, 245, 244, 0.92);
        --panel-surface: linear-gradient(
          180deg,
          rgba(255, 255, 255, 0.98),
          rgba(246, 245, 244, 0.9)
        );
        --control-surface: rgba(255, 255, 255, 0.9);
        --accent: #0075de;
        --accent-gold: #0075de;
        --accent-secondary: #005bab;
        --accent-secondary-soft: rgba(0, 117, 222, 0.08);
        --accent-secondary-strong: rgba(0, 117, 222, 0.18);
        --accent-soft: rgba(0, 117, 222, 0.1);
        --accent-strong: rgba(0, 117, 222, 0.22);
        --text-main: rgba(0, 0, 0, 0.92);
        --text-muted: #615d59;
        --border-subtle: rgba(0, 0, 0, 0.08);
        --border-strong: rgba(0, 0, 0, 0.12);
        --surface-muted: rgba(49, 48, 46, 0.05);
        --surface-frost: rgba(255, 255, 255, 0.9);
        --body-gradient-start: rgba(0, 117, 222, 0.1);
        --body-gradient-end: rgba(33, 49, 131, 0.05);
        --sidebar-bg: rgba(255, 255, 255, 0.78);
        --sidebar-surface: linear-gradient(
          180deg,
          rgba(255, 255, 255, 0.88),
          rgba(246, 245, 244, 0.92)
        );
        --sidebar-border: rgba(0, 0, 0, 0.08);
        --brand-surface: rgba(246, 245, 244, 0.92);
        --brand-border: rgba(0, 0, 0, 0.1);
        --brand-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 8px 24px rgba(0, 0, 0, 0.03);
        --badge-bg: #f2f9ff;
        --badge-border: rgba(9, 127, 232, 0.18);
        --toggle-bg: rgba(49, 48, 46, 0.08);
        --toggle-thumb: rgba(97, 93, 89, 0.66);
        --toggle-active: #0075de;
        --toggle-active-soft: rgba(0, 117, 222, 0.14);
        --toggle-active-strong: rgba(0, 117, 222, 0.22);
        --button-accent: #0075de;
        --button-accent-soft: rgba(0, 117, 222, 0.1);
        --button-accent-strong: rgba(0, 117, 222, 0.2);
        --button-accent-hover: #005bab;
        --button-shadow:
          rgba(0, 0, 0, 0.04) 0 4px 18px,
          rgba(0, 0, 0, 0.027) 0 2px 7.84688px,
          rgba(0, 0, 0, 0.02) 0 0.8px 2.925px,
          rgba(0, 0, 0, 0.01) 0 0.175px 1.04062px;
        --sidebar-text-main: rgba(0, 0, 0, 0.92);
        --sidebar-text-muted: #7a746e;
        --sidebar-active-bg: rgba(0, 117, 222, 0.08);
        --sidebar-active-text: #097fe8;
        --sidebar-dot: #0075de;
        --sidebar-badge-bg: #f2f9ff;
        --sidebar-badge-border: rgba(9, 127, 232, 0.18);
        --sidebar-badge-text: #097fe8;
        --console-bg: rgba(221, 91, 0, 0.06);
        --console-border: rgba(221, 91, 0, 0.14);
        --console-title: #dd5b00;
        --console-count-bg: rgba(221, 91, 0, 0.12);
        --console-count-text: #b54a00;
        --console-item-bg: rgba(255, 255, 255, 0.9);
        --console-item-border: rgba(221, 91, 0, 0.12);
        --console-chip-bg: rgba(221, 91, 0, 0.1);
        --console-chip-text: #b54a00;
        --overlay-bg: rgba(23, 20, 18, 0.32);
        --panel-accent-gradient: linear-gradient(
          180deg,
          rgba(0, 117, 222, 0.06),
          rgba(255, 255, 255, 0.9)
        );
        --panel-secondary-gradient: linear-gradient(
          180deg,
          rgba(49, 48, 46, 0.04),
          rgba(255, 255, 255, 0.9)
        );
        --table-row-hover: rgba(0, 117, 222, 0.04);
        --chart-grid: rgba(49, 48, 46, 0.1);
        --accent-shadow: 0 6px 22px rgba(0, 117, 222, 0.16), 0 2px 8px rgba(0, 117, 222, 0.08);
        --focus-ring: rgba(9, 127, 232, 0.18);
        --radius-xl: 20px;
        --shadow-soft:
          rgba(0, 0, 0, 0.04) 0 4px 18px,
          rgba(0, 0, 0, 0.027) 0 2px 7.84688px,
          rgba(0, 0, 0, 0.02) 0 0.8px 2.925px,
          rgba(0, 0, 0, 0.01) 0 0.175px 1.04062px;
        --shadow-deep:
          rgba(0, 0, 0, 0.01) 0 1px 3px,
          rgba(0, 0, 0, 0.02) 0 3px 7px,
          rgba(0, 0, 0, 0.02) 0 7px 15px,
          rgba(0, 0, 0, 0.04) 0 14px 28px,
          rgba(0, 0, 0, 0.05) 0 23px 52px;
      }

      :root[data-theme='dark'] {
        --bg: #1f1d1a;
        --bg-card: #262321;
        --bg-card-soft: rgba(246, 245, 244, 0.05);
        --panel-bg: rgba(255, 255, 255, 0.04);
        --panel-surface: linear-gradient(
          180deg,
          rgba(41, 37, 34, 0.96),
          rgba(31, 28, 26, 0.92)
        );
        --control-surface: rgba(255, 255, 255, 0.04);
        --accent: #62aef0;
        --accent-gold: #62aef0;
        --accent-secondary: #097fe8;
        --accent-secondary-soft: rgba(98, 174, 240, 0.12);
        --accent-secondary-strong: rgba(98, 174, 240, 0.24);
        --accent-soft: rgba(98, 174, 240, 0.14);
        --accent-strong: rgba(98, 174, 240, 0.28);
        --text-main: rgba(255, 251, 247, 0.92);
        --text-muted: #b8b0a8;
        --border-subtle: rgba(255, 255, 255, 0.09);
        --border-strong: rgba(255, 255, 255, 0.14);
        --surface-muted: rgba(255, 255, 255, 0.04);
        --surface-frost: rgba(35, 31, 29, 0.92);
        --body-gradient-start: rgba(98, 174, 240, 0.14);
        --body-gradient-end: rgba(255, 255, 255, 0.03);
        --sidebar-bg: rgba(29, 26, 24, 0.92);
        --sidebar-surface: linear-gradient(
          180deg,
          rgba(29, 26, 24, 0.96),
          rgba(23, 21, 19, 0.92)
        );
        --sidebar-border: rgba(255, 255, 255, 0.08);
        --brand-surface: rgba(255, 255, 255, 0.04);
        --brand-border: rgba(255, 255, 255, 0.1);
        --brand-shadow: none;
        --badge-bg: rgba(98, 174, 240, 0.12);
        --badge-border: rgba(98, 174, 240, 0.24);
        --toggle-bg: rgba(255, 255, 255, 0.08);
        --toggle-thumb: rgba(255, 255, 255, 0.7);
        --toggle-active: #62aef0;
        --toggle-active-soft: rgba(98, 174, 240, 0.16);
        --toggle-active-strong: rgba(98, 174, 240, 0.3);
        --button-accent: #097fe8;
        --button-accent-soft: rgba(98, 174, 240, 0.14);
        --button-accent-strong: rgba(98, 174, 240, 0.26);
        --button-accent-hover: #62aef0;
        --button-shadow:
          rgba(0, 0, 0, 0.24) 0 10px 30px,
          rgba(98, 174, 240, 0.12) 0 2px 10px;
        --sidebar-text-main: rgba(255, 251, 247, 0.92);
        --sidebar-text-muted: #b8b0a8;
        --sidebar-active-bg: rgba(98, 174, 240, 0.16);
        --sidebar-active-text: #cbe7ff;
        --sidebar-dot: #62aef0;
        --sidebar-badge-bg: rgba(98, 174, 240, 0.12);
        --sidebar-badge-border: rgba(98, 174, 240, 0.24);
        --sidebar-badge-text: #cbe7ff;
        --console-bg: rgba(221, 91, 0, 0.12);
        --console-border: rgba(221, 91, 0, 0.2);
        --console-title: #ffb27a;
        --console-count-bg: rgba(221, 91, 0, 0.18);
        --console-count-text: #ffd5b5;
        --console-item-bg: rgba(255, 255, 255, 0.03);
        --console-item-border: rgba(221, 91, 0, 0.16);
        --console-chip-bg: rgba(221, 91, 0, 0.16);
        --console-chip-text: #ffd5b5;
        --overlay-bg: rgba(8, 7, 6, 0.62);
        --panel-accent-gradient: linear-gradient(
          180deg,
          rgba(98, 174, 240, 0.08),
          rgba(23, 21, 19, 0.82)
        );
        --panel-secondary-gradient: linear-gradient(
          180deg,
          rgba(255, 255, 255, 0.03),
          rgba(23, 21, 19, 0.82)
        );
        --table-row-hover: rgba(98, 174, 240, 0.08);
        --chart-grid: rgba(255, 255, 255, 0.12);
        --accent-shadow: 0 6px 22px rgba(98, 174, 240, 0.14), 0 2px 8px rgba(98, 174, 240, 0.08);
        --focus-ring: rgba(98, 174, 240, 0.2);
        --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.28);
        --shadow-deep: 0 18px 40px rgba(0, 0, 0, 0.36), 0 24px 72px rgba(0, 0, 0, 0.28);
      }

      html {
        background: var(--bg);
      }

      body {
        font-family: 'Inter', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI',
          sans-serif;
        font-feature-settings: 'lnum' 1, 'locl' 1;
        background:
          radial-gradient(circle at top left, var(--body-gradient-start), transparent 34%),
          radial-gradient(circle at top right, var(--body-gradient-end), transparent 28%),
          var(--bg);
      }

      ::selection {
        background: var(--accent-soft);
        color: var(--text-main);
      }

      button,
      input,
      select,
      textarea {
        font: inherit;
      }

      input:not([type='checkbox']):not([type='color']):not([type='file']),
      select:not(.widget-type-select),
      textarea {
        border-radius: 10px;
        border: 1px solid var(--border-strong);
        background: var(--control-surface);
        color: var(--text-main);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
      }

      :root[data-theme='dark'] input:not([type='checkbox']):not([type='color']):not([type='file']),
      :root[data-theme='dark'] select:not(.widget-type-select),
      :root[data-theme='dark'] textarea {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
      }

      textarea {
        min-height: 100px;
        resize: vertical;
      }

      input::placeholder,
      textarea::placeholder {
        color: #a39e98;
      }

      button:focus-visible,
      input:focus-visible,
      select:focus-visible,
      textarea:focus-visible,
      .brand-trigger:focus-visible,
      .space-switcher-item:focus-visible,
      .nav-item:focus-visible,
      .finance-nav-project:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px var(--focus-ring);
      }

      .sidebar {
        padding: 24px 18px 20px;
        background: var(--sidebar-surface);
        box-shadow: inset -1px 0 0 var(--sidebar-border);
        backdrop-filter: blur(24px);
      }

      .sidebar-resizer::before {
        background: linear-gradient(180deg, transparent, var(--border-subtle), transparent);
      }

      .sidebar-resizer::after {
        background: var(--border-strong);
      }

      .brand-avatar,
      .space-switcher-item-avatar {
        border-radius: 12px;
        background: var(--brand-surface);
        border-color: var(--brand-border);
        box-shadow: var(--brand-shadow);
      }

      .space-settings-avatar-preview {
        background: var(--brand-surface);
        border-color: var(--brand-border);
        box-shadow: var(--brand-shadow);
      }

      .brand-title {
        font-size: 15px;
        font-weight: 700;
        letter-spacing: -0.03em;
      }

      .brand-subtitle {
        color: var(--sidebar-text-muted);
      }

      .space-switcher-popover {
        border-radius: 20px;
        border: 1px solid var(--border-strong);
        background: var(--surface-frost);
        box-shadow: var(--shadow-deep);
        backdrop-filter: blur(20px);
      }

      .space-switcher-head {
        background: var(--panel-bg);
        border-color: var(--border-subtle);
      }

      .space-switcher-item.current {
        border-color: var(--sidebar-badge-border);
        background: var(--sidebar-active-bg);
      }

      .space-switcher-title,
      .nav-section-title,
      .panel-title {
        letter-spacing: 0.12em;
        font-weight: 600;
      }

      .nav-item,
      .nav-item-group .nav-row,
      .finance-nav-project,
      .nav-item.sidebar-settings-btn {
        border-radius: 10px;
      }

      .nav-item:not(.nav-item-group):hover,
      .nav-item:not(.nav-item-group):focus-within,
      .nav-item-group:hover .nav-row,
      .nav-item-group:focus-within .nav-row,
      .finance-nav-project:hover,
      .space-switcher-item:hover,
      .space-switcher-item:focus-visible {
        background: rgba(0, 117, 222, 0.06);
        color: var(--sidebar-text-main);
      }

      .nav-item.active,
      .nav-item-group.active .nav-row,
      .finance-nav-project.active {
        box-shadow: inset 0 0 0 1px var(--sidebar-badge-border);
      }

      .nav-rename-btn:hover,
      .nav-tree-btn:hover,
      .finance-nav-action:hover {
        background: var(--panel-bg);
        border-color: var(--border-strong);
      }

      .sidebar .badge {
        background: var(--badge-bg);
        border-color: var(--badge-border);
        color: var(--accent);
      }

      .sidebar .btn.secondary {
        background: var(--control-surface);
        border-color: var(--border-strong);
        color: var(--text-main);
      }

      .main {
        padding: 28px 28px 24px;
        gap: 16px;
      }

      .main-header {
        padding: 4px 2px 12px;
      }

      .main-title {
        font-size: clamp(2rem, 3vw, 2.85rem);
        line-height: 1.02;
        letter-spacing: -0.06em;
        font-weight: 700;
        font-feature-settings: 'lnum' 1, 'locl' 1;
      }

      .main-subtitle {
        max-width: 60ch;
        font-size: 14px;
        line-height: 1.5;
      }

      .main-header-right {
        gap: 10px;
        flex-wrap: wrap;
        justify-content: flex-end;
      }

      .badge,
      .widget-badge,
      .widget-type-control,
      .admin-pill-type,
      .pill,
      .space-switcher-badge,
      .project-admin-code {
        letter-spacing: 0.04em;
      }

      .badge {
        padding: 5px 10px;
        font-size: 12px;
        font-weight: 600;
        color: var(--accent);
        background: var(--badge-bg);
        border-color: var(--badge-border);
      }

      .panel,
      .stat-card,
      .planfact-card,
      .report-block,
      .crm-workspace-card,
      .crm-project-card,
      .crm-board-shell,
      .crm-finance-rule-card,
      .crm-finance-compare-card,
      .crm-kanban-column,
      .crm-board-add-column {
        background: var(--panel-surface);
        border-color: var(--border-strong);
        box-shadow: var(--shadow-soft);
      }

      .crm-task-card,
      .crm-list-item,
      .crm-entry-row,
      .crm-category-row {
        background: var(--panel-surface);
        border-color: var(--border-strong);
      }

      .panel {
        border-radius: 18px;
        padding: 16px;
      }

      .panel-title {
        font-size: 11px;
      }

      .tabs {
        padding: 4px;
        background: var(--panel-bg);
        border-color: var(--border-subtle);
      }

      .tab {
        padding: 6px 12px;
        font-size: 12px;
        font-weight: 500;
      }

      .tab.active {
        background: rgba(255, 255, 255, 0.88);
        color: var(--text-main);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
      }

      :root[data-theme='dark'] .tab.active,
      :root[data-theme='dark'] .auth-mode-btn.active {
        background: rgba(255, 255, 255, 0.08);
      }

      .btn {
        font-size: 13px;
        line-height: 1.25;
        font-weight: 600;
        padding: 8px 14px;
        border-radius: 10px;
        border: 1px solid transparent;
        background: var(--button-accent);
        color: #ffffff;
        box-shadow: none;
      }

      .btn.secondary {
        background: var(--control-surface);
        border-color: var(--border-strong);
        color: var(--text-main);
      }

      .btn:hover {
        transform: translateY(-1px);
        box-shadow: var(--button-shadow);
      }

      .btn:active {
        transform: translateY(0);
      }

      .btn:not(.secondary):not(.danger):not(.finance-income):not(.finance-expense):not(.finance-category):hover {
        background: var(--button-accent-hover);
      }

      .theme-toggle {
        gap: 8px;
        font-size: 12px;
        font-weight: 500;
      }

      .widgets-grid,
      .stat-grid,
      .planfact-grid,
      .planfact-charts,
      .planfact-mini-charts,
      .report-blocks,
      .crm-dashboard-grid,
      .crm-finance-summary,
      .crm-mini-grid {
        gap: 14px;
      }

      .widget-card {
        background: var(--panel-surface);
        border-color: var(--border-strong);
        border-radius: 18px;
        padding: 16px;
        box-shadow: var(--shadow-soft);
        transition:
          transform 0.16s ease,
          box-shadow 0.16s ease,
          border-color 0.16s ease,
          background 0.16s ease;
      }

      .widget-card:hover,
      .stat-card:hover,
      .planfact-card:hover,
      .report-block:hover,
      .crm-workspace-card:hover,
      .crm-project-card:hover,
      .crm-board-shell:hover,
      .crm-finance-rule-card.is-clickable:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-deep);
      }

      .widget-card.widget-placeholder {
        background: rgba(0, 117, 222, 0.06);
      }

      .widget-card.dragging,
      .widget-card.dragging:hover {
        transform: none !important;
        box-shadow: 0 24px 60px rgba(17, 24, 39, 0.18) !important;
      }

      body.widget-drag-active .widget-card,
      body.widget-drag-active .widget-card:hover {
        transition: none !important;
      }

      body.widget-drag-active .widget-card:not(.dragging),
      body.widget-drag-active .widget-card:not(.dragging):hover {
        transform: none !important;
        box-shadow: var(--shadow-soft) !important;
      }

      .widget-header {
        margin-bottom: 12px;
      }

      .widget-title {
        font-size: 16px;
        font-weight: 600;
        letter-spacing: -0.02em;
      }

      .widget-desc,
      .widget-kpi-hint,
      .widget-total,
      .legend-label,
      .planfact-muted,
      .crm-list-meta,
      .crm-task-meta,
      .crm-muted,
      .status-message {
        color: var(--text-muted);
      }

      .widget-desc {
        font-size: 12px;
        line-height: 1.5;
      }

      .widget-badge,
      .widget-type-control,
      .admin-pill-type {
        background: var(--badge-bg);
        border-color: var(--badge-border);
        color: var(--accent);
      }

      .widget-kpi-value {
        font-size: clamp(1.75rem, 3vw, 2.4rem);
        font-weight: 700;
        line-height: 1.05;
        letter-spacing: -0.05em;
      }

      .status-message {
        font-size: 12px;
        min-height: 18px;
        line-height: 1.5;
      }

      .project-admin-panel,
      .user-admin-panel,
      .crm-empty,
      .crm-modal-info {
        background: var(--panel-bg);
        border-color: var(--border-strong);
      }

      .admin-input,
      .auth-form input {
        padding: 10px 12px;
        font-size: 13px;
        border-radius: 10px;
      }

      .auth-card,
      .crm-dialog-card {
        background: var(--surface-frost);
        border: 1px solid var(--border-strong);
        box-shadow: var(--shadow-deep);
        backdrop-filter: blur(18px);
      }

      .auth-card {
        padding: 28px;
      }

      .auth-title {
        font-size: 30px;
        line-height: 1.05;
        letter-spacing: -0.05em;
        font-weight: 700;
        margin-bottom: 10px;
      }

      .auth-subtitle {
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 20px;
      }

      .auth-mode-switch {
        background: var(--panel-bg);
      }

      .auth-mode-btn.active {
        background: rgba(255, 255, 255, 0.88);
        color: var(--text-main);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
      }

      .crm-list-title,
      .crm-task-title,
      .crm-column-title,
      .crm-finance-compare-card-title {
        font-weight: 600;
        letter-spacing: -0.01em;
      }

      .crm-finance-rule-card .value,
      .crm-finance-compare-metric-value,
      .stat-card .value,
      .planfact-kpi .value {
        letter-spacing: -0.03em;
      }

      .proj-filters input,
      .proj-filters select,
      .filters select,
      .crm-finance-filters select,
      .crm-finance-filters input,
      .crm-finance-compare-controls select,
      #crmProfileSelect {
        background: var(--control-surface);
        border-color: var(--border-strong);
      }

      .proj-table th,
      .planfact-table th,
      .cmp-table th {
        text-transform: uppercase;
        letter-spacing: 0.06em;
        font-size: 10px;
      }

      .proj-table td,
      .planfact-table td,
      .cmp-table td {
        color: var(--text-main);
      }

      .report-block {
        line-height: 1.65;
      }

      .pill {
        width: auto;
        padding: 8px 12px;
        font-size: 12px;
        font-weight: 600;
        background: var(--badge-bg);
        border-color: var(--badge-border);
        color: var(--accent);
      }

      .crm-drag-handle,
      .space-emoji-chip,
      .space-color-chip {
        background: var(--control-surface);
        border-color: var(--border-strong);
      }

      .layout,
      .section-columns {
        gap: 16px;
      }

      .theme-toggle input,
      .switch input {
        background: var(--toggle-bg);
        border-color: var(--border-strong);
      }

      @media (max-width: 1180px) {
        .layout,
        .section-columns {
          grid-template-columns: 1fr;
        }
      }

      @media (max-width: 900px) {
        .sidebar {
          padding: 18px 14px 16px;
        }

        .main {
          padding: 20px 16px 24px;
        }

        .main-header {
          flex-direction: column;
          align-items: flex-start;
        }

        .main-header-right {
          width: 100%;
          justify-content: flex-start;
        }

        .main-title {
          font-size: clamp(1.75rem, 7vw, 2.25rem);
        }
      }
