/* ── Search ── */
.dept-search-wrap {
    position: relative;
    max-width: 480px;
    margin-bottom: 2rem;
}
.dept-search-wrap .dept-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ds-muted);
    font-size: 1.1rem;
    pointer-events: none;
}
.dept-search {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.75rem;
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius);
    font-family: var(--ds-font-body);
    font-size: 0.9rem;
    background: #fff;
    transition: border-color var(--ds-transition), box-shadow var(--ds-transition);
}
.dept-search:focus {
    outline: none;
    border-color: var(--ds-primary);
    box-shadow: 0 0 0 3px rgba(var(--ds-primary-rgb), 0.1);
}
.dept-search-count {
    font-size: 0.78rem;
    color: var(--ds-muted);
    margin-top: 0.35rem;
}

/* ── Tabs ── */
.dept-tabs {
    border-bottom: 2px solid var(--ds-line);
    margin-bottom: 2rem;
    gap: 0;
}
.dept-tabs .nav-link {
    font-family: var(--ds-font-display);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--ds-muted);
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    padding: 0.75rem 1.25rem;
    transition: color var(--ds-transition), border-color var(--ds-transition);
    margin-bottom: -2px;
}
.dept-tabs .nav-link:hover {
    color: var(--ds-dark);
}
.dept-tabs .nav-link.active {
    color: var(--ds-primary);
    border-bottom-color: var(--ds-primary);
    background: none;
}

/* ── Category heading (visible during search) ── */
.dept-category-heading {
    display: none;
    font-family: var(--ds-font-display);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ds-slate);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--ds-line);
    margin-bottom: 1rem;
}
.dept-category-heading i {
    margin-right: 0.35rem;
}

/* ── Card ── */
.dept-card {
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius);
    background: #fff;
    overflow: hidden;
    transition: transform var(--ds-transition), box-shadow var(--ds-transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}
.dept-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ds-shadow-hover);
}

.dept-card-thumb {
    aspect-ratio: 16 / 10;
    background: var(--ds-gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.dept-card-thumb img {
    max-width: 70%;
    max-height: 70%;
    object-fit: contain;
}
.dept-card-thumb .dept-placeholder {
    font-family: var(--ds-font-display);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--ds-muted);
    opacity: 0.4;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    user-select: none;
}

.dept-card-body {
    padding: 1rem 1.15rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.dept-card-code {
    font-family: var(--ds-font-display);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ds-primary);
    margin-bottom: 0.25rem;
}
.dept-card-name {
    font-family: var(--ds-font-display);
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--ds-dark);
    line-height: 1.4;
    flex: 1;
}

.dept-card-footer {
    padding: 0.65rem 1.15rem;
    border-top: 1px solid var(--ds-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.dept-card-filetype {
    font-family: var(--ds-font-display);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ds-muted);
    background: var(--ds-gray-200);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}
.dept-card-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--ds-primary);
    color: #fff;
    font-size: 1rem;
    transition: background var(--ds-transition);
    text-decoration: none;
}
.dept-card-download:hover {
    background: var(--ds-primary-dark);
    color: #fff;
}

/* ── Avatar section ── */
.dept-avatar-heading {
    font-family: var(--ds-font-display);
    font-weight: 700;
    font-size: 0.85rem;
    color: #25D366;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--ds-line);
}
.dept-avatar-heading i {
    margin-right: 0.35rem;
}

.dept-card-thumb--avatar {
    aspect-ratio: 1 / 1;
    background: var(--ds-gray-200);
}
.dept-card-thumb--avatar img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.dept-card-download-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #25D366;
    color: #fff;
    font-size: 1rem;
    transition: background var(--ds-transition);
    text-decoration: none;
}
.dept-card-download-avatar:hover {
    background: #128C7E;
    color: #fff;
}

.dept-card-footer.no-download {
    justify-content: center;
}
.dept-card-footer .dept-no-file {
    font-size: 0.72rem;
    color: var(--ds-muted);
    font-style: italic;
}

/* ── No results ── */
.dept-no-results {
    display: none;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--ds-muted);
    font-size: 0.95rem;
}
.dept-no-results i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

/* ── Responsive ── */
@media (max-width: 575.98px) {
    .dept-tabs .nav-link {
        font-size: 0.78rem;
        padding: 0.6rem 0.75rem;
    }
    .dept-card-thumb .dept-placeholder {
        font-size: 1.1rem;
    }
}
