/* =============================================
     Tab Bar
     ============================================= */
     .tab-bar {
        display: flex;
        gap: 4px;
    }
    
    .tab-bar__btn {
        flex: 1;
        border-radius: var(--radius-sm);
        color: var(--color-text-muted);
        font-weight: 500;
    }
    
    /* Col1 top bar — menu left, logo center, phone right */
    .col1-top-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      padding: 4px 4px;
    }

    .col1-logo {
      flex: 1;
      height: 28px;
      object-fit: contain;
      pointer-events: none;
      user-select: none;
    }

    /* Tab badge */
    .tab-badge[hidden] { display: none !important; }

    .tab-bar__btn { position: relative; }

    .tab-badge {
      position: absolute;
      top: 2px;
      right: 2px;
      min-width: 15px;
      height: 15px;
      padding: 0 3px;
      font-size: 9px;
      font-weight: 700;
      line-height: 15px;
      color: #fff;
      background: var(--color-red, #e11d48);
      border-radius: 99px;
      letter-spacing: 0;
      pointer-events: none;
    }

    .tab-bar__btn.active .tab-badge {
      background: #fff;
      color: var(--color-primary);
    }

    .tab-bar__btn.active {
        background: rgba(0,0,0,.06);
        color: var(--color-primary);
        font-weight: 600;
    }
    
    /* =============================================
         Chat List
         ============================================= */
    .col__middle {
        display: flex;
        flex-direction: column;
        gap: 2px;
        padding: 8px 6px;
    }
    
    .chat-item {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
        padding: 8px 10px;
        border: none;
        border-radius: var(--radius-md);
        background: transparent;
        cursor: pointer;
        text-align: left;
        transition: background var(--transition);
        font-family: var(--font);
        color: var(--color-text);
    }
    
    .chat-item:hover  { background: rgba(0,0,0,.04); }
    .chat-item.active { background: rgba(10,23,131,.08); }
    
    .chat-item__avatar {
        flex: 0 0 38px;
        width: 38px;
        height: 38px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
    }
    
    .chat-item__avatar svg { width: 16px; height: 16px; }
    
    .chat-item__avatar--dialog {
        border: 1px solid color-mix(in srgb, var(--color-primary) 30%, transparent);
        color: var(--color-primary);
    }
    .chat-item__avatar--group  { background: #475569; }
    
    .chat-item__body {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 3px;
    }
    
    .chat-item__row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
    }
    
    .chat-item__name {
        font-weight: 600;
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .chat-item__time {
        font-size: 11px;
        color: var(--color-text-muted);
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .chat-item__last {
        font-size: 12px;
        color: var(--color-text-muted);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
    }
    
    /* =============================================
         Badge
         ============================================= */
    .badge {
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 9px;
        background: var(--color-primary);
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        line-height: 1;
    }
    
    /* =============================================
         Empty hint
         ============================================= */
    .empty-hint {
        padding: 24px 12px;
        text-align: center;
        color: var(--color-text-muted);
        font-size: 13px;
    }
    
    /* =============================================
         Col top / bottom padding override
         ============================================= */
    .col__top    { padding: 8px; }
    .col__bottom { padding: 8px; }
    
    /* =============================================
         Contacts
         ============================================= */
    .dept {
        margin-bottom: 4px;
    }
    
    .dept__header {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 6px 8px;
        border: none;
        border-radius: var(--radius-sm);
        background: transparent;
        cursor: pointer;
        font-family: var(--font);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: var(--color-text-muted);
        transition: background var(--transition);
        text-align: left;
    }
    
    .dept__header:hover { background: rgba(0,0,0,.04); }
    
    .dept__dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        flex-shrink: 0;
    }
    
    .dept__name { flex: 1; }
    
    .dept__count {
        font-size: 10px;
        font-weight: 600;
        color: var(--color-text-muted);
    }
    
    .dept__chevron {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
        transition: transform var(--transition);
    }
    
    .dept--collapsed .dept__chevron { transform: rotate(-90deg); }
    
    .dept__list {
        display: flex;
        flex-direction: column;
        gap: 1px;
        overflow: hidden;
        transition: max-height 250ms ease;
    }
    
    .dept--collapsed .dept__list {
        max-height: 0 !important;
    }
    
    /* Contact item */
    .contact-item {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 6px 8px;
        border: none;
        border-radius: var(--radius-sm);
        background: transparent;
        cursor: pointer;
        font-family: var(--font);
        text-align: left;
        transition: background var(--transition);
        color: var(--color-text);
    }
    
    .contact-item:hover { background: rgba(0,0,0,.04); }
    .contact-item.active { background: rgba(10,23,131,.08); }
    
    .contact-item__avatar {
        position: relative;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: var(--color-bg);
        border: 2px solid var(--color-border);
        flex-shrink: 0;
    }
    
    .contact-item__status {
        position: absolute;
        bottom: -3px;
        right: -3px;
        width: 13px;
        height: 13px;
        border-radius: 50%;
        border: 2px solid var(--color-surface);
        background: var(--color-border);
    }
    
    /* Shape: --online = circle, --unauth = dash */
    /* Color: --working = green, --paused = red (default = gray until work_status known) */
    
    .contact-item__status--online { }
    .contact-item__status--unauth {
        border-radius: 99px;
        width: 18px;
        height: 6px;
        bottom: 6px;
        right: -3px;
    }
    
    /* Work status colors */
    .contact-item__status--working { background: #22c55e; }
    .contact-item__status--paused  { background: #ef4444; }
    
    .contact-item__name {
        font-size: 14px;
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    
    /* =============================================
       Contacts search bar
       ============================================= */
    .contacts-search {
      padding: 8px 8px;
      position: sticky;
      top: 0;
      background: var(--color-surface);
      z-index: 10;
    }
    
    .contacts-search__wrap {
      display: flex;
      align-items: center;
      gap: 6px;
      background: var(--color-surface-2);
      border: 1px solid var(--color-border);
      border-radius: var(--radius-md);
      padding: 0 8px;
    }
    
    .contacts-search__icon {
      display: flex;
      color: var(--color-text-muted);
      flex-shrink: 0;
    }
    .contacts-search__icon svg { width: 14px; height: 14px; }
    
    .contacts-search__input {
      flex: 1;
      border: none;
      background: transparent;
      outline: none;
      font-size: 13px;
      color: var(--color-text);
      padding: 7px 0;
      font-family: var(--font);
    }
    .contacts-search__input::placeholder { color: var(--color-text-muted); }
    
    .contacts-search__clear {
      display: flex;
      align-items: center;
      justify-content: center;
      background: none;
      border: none;
      cursor: pointer;
      color: var(--color-text-muted);
      padding: 2px;
      border-radius: 50%;
      flex-shrink: 0;
    }
    .contacts-search__clear:hover { color: var(--color-text); background: var(--color-border); }
    .contacts-search__clear svg   { width: 13px; height: 13px; }
    
    /* Call type chat avatar */
    .chat-item__avatar--call { background: #0891b2; color: #fff; }
    
    /* Col1 top bar — menu left, phone right */
    .col1-top-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      padding: 4px 4px;
    }
/* =============================================
   SW Update Banner
   ============================================= */
.sw-update-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 6px 6px 2px;
    padding: 10px 12px;
    background: color-mix(in srgb, var(--color-primary) 8%, var(--color-surface));
    border: 1px solid color-mix(in srgb, var(--color-primary) 25%, transparent);
    border-radius: var(--radius-md);
}

.sw-update-banner__text {
    font-size: 13px;
    color: var(--color-text);
    font-weight: 500;
    flex: 1;
}

.sw-update-banner__btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* =============================================
   About iframe
   ============================================= */
.about-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    flex: 1;
}