/* Шапка, навигация, подвкладки, сортировка/поиск, поля ввода */

/* Header Bar */
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 2px 0;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--spring-transition);
}

.header-brand:active {
    transform: scale(0.96);
}

.header-logo-container {
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo-img {
    max-height: 34px;
    width: auto;
    object-fit: contain;
    display: none;
    transition: filter 0.25s ease;
}

[data-theme="light"] .header-logo-img {
    filter: invert(0.85) hue-rotate(180deg) saturate(200%);
}

[data-theme="dark"] .header-logo-img {
    filter: none;
}

.header-brand-fallback {
    display: flex;
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-md);
}

.header-title-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
    line-height: 1.2;
    transition: var(--transition);
}

.header-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-btn {
    position: relative;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--spring-transition);
    box-shadow: var(--shadow-sm);
}

.icon-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.icon-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--primary-light);
}

.bell-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: var(--error);
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 10px;
    padding: 2px 5px;
    border: 2px solid var(--bg);
    display: none;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Навигация */
.main-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: var(--surface-solid);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.nav-btn {
    flex: 1;
    padding: 9px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--spring-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.nav-btn:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.nav-btn.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 3px 10px var(--primary-light);
}

.sub-nav {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.sub-nav-btn {
    flex: 1;
    padding: 8px 6px;
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    border-radius: var(--radius-sm);
    background: var(--surface-solid);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--spring-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
}

.sub-nav-btn:hover {
    border-color: var(--primary);
    color: var(--text);
}

.sub-nav-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.sort-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.sort-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-solid);
    padding: 4px 10px 4px 6px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    height: 40px;
}

.sort-dir-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--primary);
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    height: 30px;
    transition: var(--spring-transition);
}

.pyramid-icon {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sort-dir-btn.asc .pyramid-icon {
    transform: rotate(180deg);
}

.expandable-search {
    display: flex;
    align-items: center;
    min-width: 40px;
    max-width: 40px;
    height: 40px;
    overflow: hidden;
    transition: max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.expandable-search.open {
    max-width: 100%;
    flex: 1;
}

.expandable-search input {
    border: none;
    background: transparent;
    padding: 8px 12px 8px 0;
    outline: none;
    color: var(--text);
    font-size: 12px;
    width: 100%;
    display: none;
}

.expandable-search.open input { display: block; }

.search-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    min-width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

select, input[type="text"], input[type="password"], input[type="date"], input[type="number"], textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

select:focus, input:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%2364748b' height='16' viewBox='0 0 24 24' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
    border: none;
    background-color: transparent;
    color: var(--text);
}

select option {
    background-color: var(--surface-solid);
    color: var(--text);
}

[data-theme="dark"] select option {
    background-color: #1e293b;
    color: #f8fafc;
}
