/* ═══ STUDIOHAUS PORTAL — Sidebar Styles ═══ */

    /* ─── ADMIN ─── */
    /* ─── APP SHELL (admin permanent sidebar layout) ─── */
    .app-shell {
      min-height: 100vh;
      position: relative;
      z-index: 1;
    }
    .app-content {
      margin-left: 240px;
      padding: 28px 36px;
      overflow-x: auto;
      overflow-y: auto;
      min-height: 100vh;
      animation: pageTransition 0.3s ease-out;
    }
    @media (max-width: 768px) {
      .app-content { margin-left: 0; padding: 60px 16px 20px; }
    }
    .admin-sidebar {
      background: rgba(17, 17, 17, 0.85);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border-right: 1px solid var(--border);
      padding: 0;
      display: flex;
      flex-direction: column;
      overflow-y: auto;
      position: fixed;
      top: 0;
      left: 0;
      bottom: 0;
      width: 240px;
      z-index: 100;
    }
    .admin-sidebar-brand {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 20px 20px 16px;
      border-bottom: 1px solid var(--border);
      margin-bottom: 10px;
      flex-shrink: 0;
    }
    .admin-sidebar-brand-icon {
      width: 32px; height: 32px;
      border-radius: var(--radius-sm);
      background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 800;
      font-size: 14px;
      color: #0a0a0a;
      flex-shrink: 0;
    }
    .admin-sidebar-brand-text {
      font-weight: var(--fw-semi);
      font-size: var(--fs-lg);
      color: var(--text);
      letter-spacing: -0.01em;
    }
    .admin-sidebar-label {
      font-size: 10px;
      font-weight: var(--fw-semi);
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: var(--text-40);
      padding: 8px 20px;
      flex-shrink: 0;
    }
    .admin-sidebar-item {
      display: flex;
      align-items: center;
      gap: var(--s-3);
      padding: 8px 16px;
      margin: 1px 8px;
      font-size: var(--fs-sm);
      color: var(--text-60);
      cursor: pointer;
      border: none;
      background: none;
      font-family: var(--font);
      width: calc(100% - 16px);
      text-align: left;
      transition: color 0.25s ease, background 0.3s ease, transform 0.15s ease;
      border-radius: var(--radius-sm);
      position: relative;
      overflow: hidden;
      flex-shrink: 0;
    }
    .admin-sidebar-item:hover {
      color: var(--text);
      background: rgba(255,255,255,0.03);
    }
    .admin-sidebar-item:active {
      transform: scale(0.97);
    }
    .admin-sidebar-item:focus-visible {
      outline: 2px solid var(--focus);
      outline-offset: -2px;
    }
    .admin-sidebar-item.active {
      color: var(--text);
      background: rgba(var(--brand-accent-rgb), 0.08);
    }
    .admin-sidebar-item.active::before {
      content: '';
      position: absolute;
      left: 0;
      top: 6px;
      bottom: 6px;
      width: 3px;
      border-radius: 0 3px 3px 0;
      background: var(--brand-accent);
      animation: accentSlideIn 0.3s ease-out;
    }
    @keyframes accentSlideIn {
      from { transform: scaleY(0); opacity: 0; }
      to { transform: scaleY(1); opacity: 1; }
    }
    .admin-sidebar-icon {
      width: 18px;
      height: 18px;
      opacity: 0.45;
      flex-shrink: 0;
      transition: opacity 0.25s ease, transform 0.2s ease, filter 0.25s ease;
    }
    .admin-sidebar-item:hover .admin-sidebar-icon { opacity: 0.7; }
    .admin-sidebar-item.active .admin-sidebar-icon { opacity: 1; }
    .admin-sidebar-divider {
      height: 1px;
      background: var(--border);
      margin: 14px 20px;
      flex-shrink: 0;
    }
    .admin-sidebar-footer {
      margin-top: auto;
      padding: 16px 20px;
      border-top: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 10px;
      color: var(--text-40);
      letter-spacing: 0.05em;
      flex-shrink: 0;
    }
    .sidebar-theme-toggle {
      transform: scale(0.8);
      transform-origin: right center;
    }

    /* ─── Global Search ─── */
    .sidebar-search {
      padding: 8px 16px 12px;
      flex-shrink: 0;
    }
    .sidebar-search-input {
      width: 100%;
      padding: 8px 12px 8px 32px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.04);
      color: var(--text);
      font-family: var(--font);
      font-size: 12px;
      border-radius: 100px;
      outline: none;
      transition: all 0.2s;
      position: relative;
    }
    .sidebar-search-input::placeholder { color: var(--text-40); }
    .sidebar-search-input:focus { border-color: rgba(var(--brand-accent-rgb),0.3); background: rgba(255,255,255,0.07); }
    .sidebar-search-wrap {
      position: relative;
    }
    .sidebar-search-icon {
      position: absolute;
      left: 10px;
      top: 50%;
      transform: translateY(-50%);
      width: 14px;
      height: 14px;
      color: var(--text-40);
      pointer-events: none;
    }
    .search-results {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      background: var(--bg-elevated);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      max-height: 320px;
      overflow-y: auto;
      z-index: 200;
      box-shadow: 0 12px 40px rgba(0,0,0,0.3);
      margin-top: 4px;
    }
    .search-result-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 14px;
      cursor: pointer;
      transition: background 0.15s;
      border-bottom: 1px solid var(--border);
    }
    .search-result-item:last-child { border-bottom: none; }
    .search-result-item:hover { background: var(--bg-card); }
    .search-result-type {
      font-size: 9px;
      text-transform: uppercase;
      letter-spacing: 1px;
      padding: 2px 6px;
      border-radius: 100px;
      font-weight: 600;
      flex-shrink: 0;
    }
    /* Search result type tags — match the CATEGORY_COLORS palette in
       config.js so categorization is consistent across the portal. */
    .search-result-type.project    { color: #6a8fb8; background: rgba(106,143,184,0.14); }
    .search-result-type.client     { color: #8868a8; background: rgba(136,104,168,0.14); }
    .search-result-type.booking    { color: #7aab8a; background: rgba(122,171,138,0.14); }
    .search-result-type.contractor { color: #5e9a98; background: rgba(94,154,152,0.14); }
    .search-result-type.collaborator { color: #8070b8; background: rgba(128,112,184,0.14); }
    .search-result-type.invoice    { color: #d4a547; background: rgba(212,165,71,0.14); }
    .search-result-name {
      font-size: 13px;
      color: var(--text);
      flex: 1;
    }
    .search-result-detail {
      font-size: 11px;
      color: var(--text-40);
    }
    .search-empty {
      padding: 16px;
      text-align: center;
      color: var(--text-40);
      font-size: 12px;
    }

    /* ─── Light mode for admin sidebar ─── */
    [data-theme="light"] .admin-sidebar {
      background: rgba(240, 239, 237, 0.95);
      border-right-color: rgba(0,0,0,0.08);
    }
    [data-theme="light"] .admin-sidebar-item {
      color: rgba(0,0,0,0.6);
    }
    [data-theme="light"] .admin-sidebar-item:hover {
      background: rgba(0,0,0,0.05);
      color: rgba(0,0,0,0.8);
    }
    [data-theme="light"] .admin-sidebar-item.active {
      background: rgba(0,0,0,0.08);
      color: #1a1a1a;
    }
    [data-theme="light"] .admin-sidebar-label {
      color: rgba(0,0,0,0.4);
    }
    [data-theme="light"] .admin-sidebar-brand-text {
      color: #1a1a1a;
    }
    [data-theme="light"] .admin-sidebar-footer {
      border-top-color: rgba(0,0,0,0.08);
      color: rgba(0,0,0,0.4);
    }
    [data-theme="light"] .sop-card-title { color: #fff; }
    [data-theme="light"] .sop-modal-title { color: #fff; }
    [data-theme="light"] .mon-person {
      background: rgba(0,0,0,0.08);
      color: #1a1a1a;
    }
    [data-theme="light"] .mon-person-empty {
      border-color: rgba(0,0,0,0.15);
    }
    [data-theme="light"] .mon-person-empty:hover {
      border-color: rgba(0,0,0,0.3);
      color: rgba(0,0,0,0.5);
    }
    [data-theme="light"] .modal {
      background: rgba(245, 245, 243, 0.88);
      border: 1px solid rgba(0,0,0,0.08);
      box-shadow: 0 24px 80px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.5);
    }
    [data-theme="light"] .admin-table th {
      color: rgba(0,0,0,0.5);
      border-bottom-color: rgba(0,0,0,0.08);
    }
    [data-theme="light"] .admin-table td {
      border-bottom-color: rgba(0,0,0,0.05);
    }
    [data-theme="light"] .sop-card {
      border-color: rgba(0,0,0,0.1);
    }
    [data-theme="light"] .sop-card:hover {
      border-color: rgba(0,0,0,0.2);
    }

    .admin-content {
      padding: 28px 36px;
      overflow-x: auto;
      animation: contentFadeIn 0.3s ease;
    }
    @keyframes contentFadeIn {
      from { opacity: 0; transform: translateY(6px); }
      to { opacity: 1; transform: translateY(0); }
    }
    /* ─── Mobile: convert sidebar into a fixed bottom tab bar ───
       Hides categorical labels (Overview/Client/Finance/...) and brand
       chrome, surfaces the most-used items as evenly-spaced tabs.
       Items hidden in mobile use [data-mobile-hide]; pages that want
       a primary item visible use [data-mobile-show]. */
    @media (max-width: 768px) {
      .admin-sidebar {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        flex-direction: row;
        justify-content: space-around;
        align-items: stretch;
        overflow-x: auto;
        overflow-y: hidden;
        border-right: none;
        border-top: 1px solid var(--border);
        border-bottom: none;
        padding: 4px 4px calc(4px + env(safe-area-inset-bottom)) 4px;
        background: rgba(10, 10, 10, 0.92);
        z-index: 100;
      }
      .admin-sidebar-brand,
      .admin-sidebar-label,
      .admin-sidebar-divider,
      .admin-sidebar-footer,
      .sidebar-search { display: none; }
      .admin-sidebar-item {
        flex-direction: column;
        gap: 2px;
        padding: 6px 4px;
        margin: 0;
        width: auto;
        flex: 1 1 0;
        min-width: 0;
        font-size: 10px;
        text-align: center;
        border-radius: var(--radius-sm);
        border-bottom: none;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .admin-sidebar-item .admin-sidebar-icon { width: 22px; height: 22px; opacity: 0.55; }
      .admin-sidebar-item.active { background: transparent; color: var(--brand-accent); }
      .admin-sidebar-item.active::before {
        display: block;
        top: 0;
        bottom: auto;
        left: 50%;
        transform: translateX(-50%);
        width: 24px;
        height: 2px;
        border-radius: 0 0 2px 2px;
      }
      .admin-sidebar-item.active .admin-sidebar-icon { opacity: 1; }
      .app-shell { grid-template-columns: 1fr; }
      .app-content {
        margin-left: 0;
        padding: 16px 16px calc(72px + env(safe-area-inset-bottom)) 16px;
      }
    }
    [data-theme="light"] .admin-sidebar { background: rgba(242, 241, 239, 0.92); }
    @media (max-width: 768px) {
      [data-theme="light"] .admin-sidebar { background: rgba(242, 241, 239, 0.92); }
    }

    /* Legacy tab styles kept for compat */
    .admin-tabs { display: none; }
    .admin-tab { display: none; }

