    /* ---- Dashboard Layout ---- */
    .dashboard-container {
      padding: 24px;
      margin: 0 auto;
      width: 100%;
      background-color: #f7f7f8;
      /* Slightly darker than #fdfdfd */
      min-height: 100vh;
    }

    .dashboard-header {
      margin-bottom: 24px;
    }

    .dashboard-header h1 {
      font-size: 2rem;
      font-weight: 700;
      margin: 0 0 8px 0;
      color: var(--text-primary);
    }

    .dashboard-header p {
      color: var(--text-secondary);
      margin: 0;
      font-size: 1rem;
    }

    /* ---- Search Bar ---- */
    .search-container {
      position: relative;
      margin-bottom: 20px;
    }

    .search-input-wrapper {
      position: relative;
      display: flex;
      align-items: center;
    }

    .search-icon {
      position: absolute;
      left: 16px;
      color: var(--text-secondary);
      font-size: 0.9rem;
    }

    .global-search-input {
      width: 100%;
      padding: 12px 14px 12px 40px;
      border: 1px solid var(--border-color);
      border-radius: 8px;
      background: var(--bg-secondary);
      font-size: 0.95rem;
      color: var(--text-primary);
      transition: all 0.2s ease;
    }

    .global-search-input:focus {
      outline: none;
      border-color: var(--accent-color);
      box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    }

    .global-search-input::placeholder {
      color: var(--text-secondary);
    }

    .search-results-dropdown {
      position: absolute;
      top: calc(100% + 8px);
      left: 0;
      right: 0;
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
      z-index: 100;
      max-height: 400px;
      overflow-y: auto;
    }

    .search-results-dropdown.hidden {
      display: none;
    }

    .search-group {
      padding: 10px 0;
      border-bottom: 1px solid var(--border-color);
    }

    .search-group:last-child {
      border-bottom: none;
    }

    .search-group-title {
      padding: 0 14px 6px;
      font-size: 0.7rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--text-secondary);
    }

    .search-result-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 8px 14px;
      cursor: pointer;
      transition: background 0.15s;
      text-decoration: none;
      color: inherit;
    }

    .search-result-item:hover {
      background: var(--bg-hover);
    }

    .search-result-icon {
      width: 32px;
      height: 32px;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.85rem;
      flex-shrink: 0;
    }

    .search-result-icon.note {
      background: rgba(59, 130, 246, 0.15);
      color: #3b82f6;
    }

    .search-result-icon.deck {
      background: rgba(16, 185, 129, 0.15);
      color: #10b981;
    }

    .search-result-icon.document {
      background: rgba(239, 68, 68, 0.15);
      color: #ef4444;
    }

    .search-result-info {
      flex: 1;
      min-width: 0;
    }

    .search-result-title {
      font-weight: 500;
      font-size: 0.9rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .search-result-meta {
      font-size: 0.75rem;
      color: #666;
      font-weight: 500;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .search-see-all {
      display: block;
      text-align: center;
      padding: 12px;
      font-size: 0.85rem;
      color: var(--accent-color);
      font-weight: 500;
      cursor: pointer;
      border-top: 1px solid var(--border-color);
      transition: background 0.15s;
    }

    .search-see-all:hover {
      background: var(--bg-hover);
    }

    .search-no-results {
      padding: 24px 16px;
      text-align: center;
      color: var(--text-secondary);
      font-size: 0.9rem;
    }

    /* ---- Recent Items Grid ---- */
    .recent-items-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 16px;
      margin-bottom: 20px;
    }

    .recent-card {
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      padding: 16px;
      cursor: pointer;
      transition: border-color 0.15s ease, box-shadow 0.15s ease;
      text-decoration: none;
      color: inherit;
      display: block;
      overflow: hidden;
      min-width: 0;
    }

    .recent-card:hover {
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
      border-color: #cfd8e3;
    }

    .recent-card-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      margin-bottom: 12px;
    }

    .recent-card-icon {
      width: 44px;
      height: 44px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.1rem;
    }

    .recent-card-icon.deck {
      background: rgba(16, 185, 129, 0.15);
      color: #10b981;
    }

    .recent-card-icon.document {
      background: rgba(239, 68, 68, 0.15);
      color: #ef4444;
    }

    .recent-card-icon.note {
      background: rgba(59, 130, 246, 0.15);
      color: #3b82f6;
    }

    .recent-card-label {
      font-size: 0.75rem;
      font-weight: 500;
      color: var(--text-secondary);
      background: var(--bg-tertiary);
      padding: 3px 8px;
      border-radius: 6px;
    }

    .recent-card-title {
      font-size: 1.1rem;
      font-weight: 600;
      color: var(--text-primary);
      margin-bottom: 4px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .recent-card-meta {
      font-size: 0.85rem;
      color: #666;
      font-weight: 500;
    }

    .recent-card-empty {
      opacity: 0.5;
      pointer-events: none;
    }

    /* ---- Bottom Row ---- */
    .dashboard-bottom-row {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 16px;
      align-items: start;
    }

    .dashboard-bottom-row .activity-card {
      grid-column: span 2;
    }

    /* ---- Activity Heatmap ---- */
    .activity-card {
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      padding: 14px 16px 10px 16px;
      min-width: 0;
      /* Allow card to shrink below content size */
      overflow: hidden;
      height: 100%;
      /* Fill grid cell */
      display: flex;
      flex-direction: column;
    }

    .activity-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 10px;
      gap: 12px;
    }

    .activity-header-left {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .activity-header h3 {
      font-size: 1rem;
      font-weight: 600;
      margin: 0;
      color: var(--text-primary);
    }

    .activity-filter {
      padding: 4px 8px;
      font-size: 0.75rem;
      border-radius: 6px;
      border: 1px solid var(--border-color);
      background: var(--bg-primary);
      color: var(--text-primary);
      cursor: pointer;
    }

    .activity-legend {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 0.75rem;
      color: var(--text-secondary);
    }

    .legend-gradient {
      display: flex;
      gap: 2px;
    }

    .legend-cell {
      cursor: pointer;
      -webkit-user-select: none;
      user-select: none;
      -webkit-touch-callout: none;
      width: 10px;
      height: 10px;
      border-radius: 2px;
    }

    .heatmap-container {
      overflow: hidden;
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: center;
      padding-bottom: 14px;
    }

    .heatmap-grid {
      display: grid;
      grid-template-rows: repeat(7, 1fr);
      grid-auto-flow: column;
      gap: 2px;
      user-select: none;
      -webkit-user-select: none;
      -webkit-touch-callout: none;
    }

    .heatmap-cell {
      cursor: pointer;
      -webkit-user-select: none;
      user-select: none;
      -webkit-touch-callout: none;
      width: 10px;
      height: 10px;
      border-radius: 2px;
      background: #e2e2e5;
      transition: all 0.1s ease;
      cursor: pointer;
      -webkit-user-select: none;
      user-select: none;
      -webkit-touch-callout: none;
    }

    .heatmap-cell:hover {
      transform: scale(1.15);
      border: 1px solid var(--text-primary);
      z-index: 10;
      cursor: pointer;
    }

    .heatmap-cell.level-1 {
      background: rgba(59, 130, 246, 0.4);
    }

    .heatmap-cell.level-2 {
      background: rgba(59, 130, 246, 0.6);
    }

    .heatmap-cell.level-3 {
      background: rgba(59, 130, 246, 0.8);
    }

    .heatmap-cell.level-4 {
      background: var(--accent-color);
    }

    /* Future squares are lighter gray */
    .heatmap-cell.is-future {
      background: #f0f0f2;
    }

    /* Today's outline - thinner and less prominent */
    .heatmap-cell.is-today {
      outline: 1px solid var(--text-primary);
      outline-offset: 0px;
      z-index: 5;
    }

    .heatmap-cell.is-today:not(.level-0) {
      background: var(--accent-color) !important;
    }

    /* Marked/red state for clicked squares */
    .heatmap-cell.is-marked {
      background: #ef4444 !important;
    }

    /* Heatmap Tooltip */
    .heatmap-tooltip {
      position: fixed;
      z-index: 1000;
      background: rgba(255, 255, 255, 0.96);
      backdrop-filter: blur(4px);
      -webkit-backdrop-filter: blur(4px);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      padding: 10px;
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
      pointer-events: none;
      opacity: 0;
      transform: translateY(4px) scale(0.98);
      transition: opacity 0.15s ease, transform 0.15s ease;
      min-width: 140px;
    }

    .heatmap-tooltip.show {
      opacity: 1;
      transform: translateY(0) scale(1);
    }

    .tooltip-date {
      font-weight: 600;
      font-size: 0.8rem;
      color: var(--text-primary);
      margin-bottom: 8px;
      display: block;
      border-bottom: 1px solid var(--border-color);
      padding-bottom: 4px;
    }

    .tooltip-stat {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 0.75rem;
      margin-bottom: 4px;
      color: var(--text-secondary);
    }

    .tooltip-stat i {
      width: 14px;
      text-align: center;
    }

    .tooltip-stat.active {
      color: var(--text-primary);
      font-weight: 500;
    }

    .tooltip-stat .count {
      margin-left: auto;
      background: var(--bg-tertiary);
      padding: 1px 6px;
      border-radius: 4px;
      font-family: monospace;
    }

    /* Responsive Adjustments */
    @media (max-width: 800px) {
      .dashboard-container {
        padding: 16px;
      }

      .dashboard-welcome h1 {
        font-size: 1.8rem;
      }

      .recent-items-grid {
        grid-template-columns: 1fr;
        /* Stack recent items */
        gap: 12px;
      }

      .dashboard-bottom-row {
        grid-template-columns: 1fr;
        /* Stack heatmap and storage */
        gap: 16px;
      }

      .activity-card,
      .storage-card {
        padding: 16px;
        /* Reduce padding */
      }

      /* Responsive Heatmap */
      .heatmap-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }

      .heatmap-grid {
        min-width: 600px;
      }

      .heatmap-cell {
        width: 8px;
        height: 8px;
      }

      .heatmap-days {
        grid-template-rows: repeat(7, 10px);
        font-size: 0.55rem;
        margin-right: 8px;
      }

      .heatmap-day {
        height: 10px;
      }

      .heatmap-months {
        font-size: 0.6rem;
        min-width: 600px;
      }
    }

    .heatmap-months {
      display: grid;
      grid-template-columns: repeat(53, 10px);
      /* matches heatmap-grid gap and cell size */
      gap: 2px;
      margin-bottom: 8px;
      font-size: 0.7rem;
      color: var(--text-secondary);
      padding-left: 24px;
      /* Account for day labels column */
    }

    .heatmap-month {
      grid-row: 1;
      text-align: left;
    }

    .heatmap-days {
      display: grid;
      grid-template-rows: repeat(7, 12px);
      gap: 0;
      margin-right: 12px;
      font-size: 0.65rem;
      color: var(--text-secondary);
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .heatmap-day {
      height: 12px;
      display: flex;
      align-items: center;
      line-height: 1;
    }

    .heatmap-wrapper {
      display: flex;
      padding-top: 4px;
    }

    /* ---- Storage Card ---- */
    .storage-card {
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      padding: 14px 16px;
      display: flex;
      flex-direction: column;
    }

    .storage-card-header {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 16px;
    }

    .storage-card-icon {
      width: 40px;
      height: 40px;
      border-radius: 8px;
      background: rgba(59, 130, 246, 0.15);
      color: var(--accent-color);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.1rem;
    }

    .storage-card-header h3 {
      font-size: 1rem;
      font-weight: 600;
      margin: 0;
      color: var(--text-primary);
    }

    .storage-usage-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
      font-size: 0.85rem;
    }

    .storage-usage-label {
      color: var(--text-secondary);
      font-weight: 600;
    }

    .storage-usage-value {
      font-weight: 400;
      color: var(--text-primary);
    }

    .storage-bar {
      height: 8px;
      background: var(--bg-tertiary);
      border-radius: 4px;
      overflow: hidden;
      margin-bottom: 16px;
    }

    .storage-bar-fill {
      height: 100%;
      background: var(--accent-color);
      border-radius: 4px;
      transition: width 0.5s ease;
    }

    .storage-breakdown {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-bottom: 20px;
    }

    .storage-breakdown-row {
      display: flex;
      justify-content: space-between;
      font-size: 0.8rem;
    }

    .storage-breakdown-label {
      color: var(--text-secondary);
      font-weight: 600;
    }

    .storage-breakdown-value {
      color: var(--text-primary);
      font-weight: 400;
    }

    #manage-storage-btn {
      width: 100%;
    }

    /* ---- Responsive ---- */
    @media (max-width: 990px) {

      html,
      body {
        height: 100%;
        overflow: hidden;
        overscroll-behavior: none;
      }

      /* Fix mobile scrolling */
      .main {
        height: 100dvh;
        min-height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
      }

      .dashboard-mobile-header {
        margin-bottom: 0;
      }

      .dashboard-container {
        padding: 18px 20px 20px;
      }

      .recent-items-grid {
        grid-template-columns: 1fr;
      }

      .dashboard-bottom-row {
        grid-template-columns: 1fr;
      }

      .dashboard-bottom-row .activity-card {
        grid-column: span 1;
      }
    }

    @media (max-width: 768px) {
      .dashboard-header h1 {
        font-size: 1.5rem;
      }
    }

    /* ---- Storage Accordion Styles ---- */
    details.storage-accordion {
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      margin-bottom: 12px;
      overflow: hidden;
      transition: all 0.2s ease;
    }

    details.storage-accordion[open] {
      border-color: var(--accent-color);
      box-shadow: 0 4px 12px rgba(59, 130, 246, 0.05);
    }

    summary.storage-summary {
      padding: 12px 16px;
      cursor: pointer;
      font-weight: 600;
      color: var(--text-primary);
      display: flex;
      align-items: center;
      justify-content: space-between;
      user-select: none;
      background: var(--bg-secondary);
      transition: background 0.2s;
      list-style: none;
      /* Hide default triangle */
    }

    summary.storage-summary::-webkit-details-marker {
      display: none;
    }

    summary.storage-summary:hover {
      background-color: var(--bg-hover);
    }

    .storage-summary-titles {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .storage-summary-icon {
      color: var(--text-secondary);
      width: 20px;
      text-align: center;
      transition: color 0.2s;
    }

    details.storage-accordion[open] .storage-summary-icon {
      color: var(--accent-color);
    }

    .accordion-chevron {
      color: var(--text-secondary);
      transition: transform 0.2s ease;
      font-size: 0.8em;
    }

    details.storage-accordion[open] .accordion-chevron {
      transform: rotate(180deg);
      color: var(--accent-color);
    }

    .storage-accordion-content {
      padding: 0 12px 12px 12px;
      border-top: 1px solid var(--border-color);
      background: var(--bg-primary);
    }

    /* Modified Storage Item for inside accordion */
    .storage-item {
      padding: 10px;
      margin-bottom: 0;
      margin-top: 8px;
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      border-radius: 8px;
    }

    .storage-item:hover {
      border-color: var(--border-color);
      background: var(--bg-hover);
    }

    /* Cleanup legacy container removed */

    .storage-icon {
      width: 40px;
      height: 40px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.2rem;
      flex-shrink: 0;
    }

    .storage-info {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 2px;
      overflow: hidden;
    }

    .asset-name {
      font-weight: 500;
      color: var(--text-primary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .asset-meta {
      font-size: 0.8em;
      color: var(--text-secondary);
    }

    .storage-actions button {
      background: transparent;
      border: none;
      color: var(--text-secondary);
      padding: 8px;
      cursor: pointer;
      border-radius: 50%;
      transition: all 0.2s;
    }

    .storage-actions button:hover {
      background: var(--danger-color);
      color: white;
    }

    /* ---- Modal Styles ---- */
    .modal {
      position: fixed;
      z-index: 3000;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      overflow: auto;
      background-color: rgba(0, 0, 0, 0.5);
      backdrop-filter: blur(2px);
      display: none;
      align-items: center;
      justify-content: center;
    }

    .modal.show {
      display: flex !important;
      opacity: 1 !important;
      visibility: visible !important;
    }

    .modal.hidden {
      display: none !important;
    }

    .modal-content {
      background-color: var(--bg-primary);
      margin: auto;
      padding: 0;
      border: 1px solid var(--border-color);
      width: 100%;
      max-width: 500px;
      border-radius: 12px;
      box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
      animation: modalSlideUp 0.3s ease-out;
      position: relative;
      display: flex;
      flex-direction: column;
      max-height: 85vh;
      /* Fix padding issue */
      padding: 20px;
    }

    @keyframes modalSlideUp {
      from {
        transform: translateY(20px);
        opacity: 0;
      }

      to {
        transform: translateY(0);
        opacity: 1;
      }
    }

    .modal-header {
      padding: 0 0 16px 0;
      border-bottom: 1px solid var(--border-color);
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 10px;
    }

    .modal-header h2 {
      margin: 0;
      font-size: 1.25rem;
      font-weight: 600;
    }

    .close-btn {
      background: none;
      border: none;
      font-size: 1.2rem;
      cursor: pointer;
      color: var(--text-secondary);
      padding: 4px;
      border-radius: 4px;
      transition: background 0.2s;
    }

    .close-btn:hover {
      background: var(--bg-hover);
      color: var(--text-primary);
    }

    .modal-body {
      padding: 0;
      overflow-y: auto;
    }